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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp

Issue 2755323002: [Bindings] Emit less code per member in generated dictionary ToV8. (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
index 7dc20bc729e15957d9f97a2a9020582cff3eccf0..a0724b7549477b27227bb878267607270de592ba 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
@@ -60,9 +60,15 @@ bool toV8TestInterfaceEventInit(const TestInterfaceEventInit& impl, v8::Local<v8
if (!toV8EventInit(impl, dictionary, creationContext, isolate))
return false;
+ v8::Local<v8::Value> stringMemberValue;
+ bool stringMemberHasValueOrDefault = false;
if (impl.hasStringMember()) {
- if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8AtomicString(isolate, "stringMember"), v8String(isolate, impl.stringMember()))))
- return false;
+ stringMemberValue = v8String(isolate, impl.stringMember());
+ stringMemberHasValueOrDefault = true;
+ }
+ if (stringMemberHasValueOrDefault &&
+ !v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8AtomicString(isolate, "stringMember"), stringMemberValue))) {
+ return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698