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

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

Issue 2749253002: bindings: Expand typedefs before generating union files. (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/V8TestDictionary.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
index 77c16c242814aad201c3761e66992ca90c4b78fe..20a79e934a2b7d5b1adb0cb7cca9fe90d8826489 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
@@ -12,12 +12,10 @@
#include "V8TestDictionary.h"
#include "bindings/core/v8/Dictionary.h"
-#include "bindings/core/v8/DoubleOrString.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ScriptValue.h"
-#include "bindings/core/v8/TestInterface2OrUint8Array.h"
#include "bindings/core/v8/V8ArrayBufferView.h"
#include "bindings/core/v8/V8Element.h"
#include "bindings/core/v8/V8EventTarget.h"
@@ -594,6 +592,21 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
impl.setUint8ArrayMember(uint8ArrayMember);
}
+ v8::Local<v8::Value> unionWithTypedefsValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "unionWithTypedefs")).ToLocal(&unionWithTypedefsValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (unionWithTypedefsValue.IsEmpty() || unionWithTypedefsValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ FloatOrBoolean unionWithTypedefs;
+ V8FloatOrBoolean::toImpl(isolate, unionWithTypedefsValue, unionWithTypedefs, UnionTypeConversionMode::NotNullable, exceptionState);
+ if (exceptionState.hadException())
+ return;
+ impl.setUnionWithTypedefs(unionWithTypedefs);
+ }
+
v8::Local<v8::Value> unrestrictedDoubleMemberValue;
if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "unrestrictedDoubleMember")).ToLocal(&unrestrictedDoubleMemberValue)) {
exceptionState.rethrowV8Exception(block.Exception());
@@ -841,6 +854,11 @@ bool toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio
return false;
}
+ if (impl.hasUnionWithTypedefs()) {
+ if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8AtomicString(isolate, "unionWithTypedefs"), ToV8(impl.unionWithTypedefs(), creationContext, isolate))))
+ return false;
+ }
+
if (impl.hasUnrestrictedDoubleMember()) {
if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8AtomicString(isolate, "unrestrictedDoubleMember"), v8::Number::New(isolate, impl.unrestrictedDoubleMember()))))
return false;

Powered by Google App Engine
This is Rietveld 408576698