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

Unified Diff: Source/bindings/templates/union.cpp

Issue 713403004: IDL: Generic Dictionary support in union types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/bindings/scripts/v8_union.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/union.cpp
diff --git a/Source/bindings/templates/union.cpp b/Source/bindings/templates/union.cpp
index 48a358656dc018a3c3efe008af256ac2cb460422..3c9fbd493870146dd4c5802f219655c46033ed48 100644
--- a/Source/bindings/templates/union.cpp
+++ b/Source/bindings/templates/union.cpp
@@ -80,9 +80,11 @@ void V8{{container.cpp_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Valu
{# FIXME: This should also check "object but not Date or RegExp". Add checks
when we implement conversions for Date and RegExp. #}
if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) {
- {{container.dictionary_type.cpp_local_type}} cppValue = V8{{container.dictionary_type.type_name}}::toImpl(isolate, v8Value, exceptionState);
bashi 2014/11/12 05:13:07 This was wrong. Union type containers' toImpl() do
- if (!exceptionState.hadException())
- impl.set{{container.dictionary_type.type_name}}(cppValue);
+ {% if container.dictionary_type.type_name != 'Dictionary' %}
+ {{container.dictionary_type.cpp_local_type}} cppValue;
+ {% endif %}
+ {{container.dictionary_type.v8_value_to_local_cpp_value}};
+ impl.set{{container.dictionary_type.type_name}}(cppValue);
return;
}
« no previous file with comments | « Source/bindings/scripts/v8_union.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698