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

Unified Diff: third_party/WebKit/Source/bindings/templates/union_container.cpp

Issue 1994823002: Add !IsArray() check for dictionary conversion in union types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/LongOrTestDictionary.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/union_container.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/union_container.cpp b/third_party/WebKit/Source/bindings/templates/union_container.cpp
index 8ad45d0c7bc4b3dea841c57656a0d82cb3bea988..920d223c1e320bd9f7dc59047cdf5313b882cdd8 100644
--- a/third_party/WebKit/Source/bindings/templates/union_container.cpp
+++ b/third_party/WebKit/Source/bindings/templates/union_container.cpp
@@ -93,7 +93,10 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
{# 12. Dictionaries #}
{# 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()) {
+ {# TODO(bashi): The spec doesn't say we should check !IsArray() but otherwise
+ we can't distinguish a sequence<T> and a dictionary.
+ https://github.com/heycam/webidl/issues/123 #}
+ if (isUndefinedOrNull(v8Value) || (v8Value->IsObject() && !v8Value->IsArray())) {
{{v8_value_to_local_cpp_value(dictionary_type) | indent(8)}}
impl.set{{dictionary_type.type_name}}(cppValue);
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698