Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl

Issue 2748353003: [Bindings] Remove redundant ToObject invocation in dictionary toImpl. (Closed)
Patch Set: cast directly after check Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl
index 6146238c740ee40050d1a8a9b76532efc58ab139..7e78fbd48104d6fea6d9c23cef9f2a0271d05455 100644
--- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl
@@ -27,6 +27,8 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
return;
{% endif %}
}
+ v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>();
+ (void)v8Object;
Yuki 2017/03/17 06:07:33 nit: You can use ALLOW_UNUSED_LOCAL, just FYI.
jbroman 2017/03/17 14:50:26 I'd thought that wtf had something and couldn't fi
{% if parent_v8_class %}
{{parent_v8_class}}::toImpl(isolate, v8Value, impl, exceptionState);
@@ -37,11 +39,6 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
{# Declare local variables only when the dictionary has members to avoid unused variable warnings. #}
{% if members %}
v8::TryCatch block(isolate);
- v8::Local<v8::Object> v8Object;
- if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) {
- exceptionState.rethrowV8Exception(block.Exception());
- return;
- }
{% endif %}
{% for member in members %}
{% filter runtime_enabled(member.runtime_enabled_feature_name) %}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698