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

Unified Diff: Source/bindings/scripts/v8_dictionary.py

Issue 1130763006: IDL: Add any support to IDL dictionary and use it in CustomEventInit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
Index: Source/bindings/scripts/v8_dictionary.py
diff --git a/Source/bindings/scripts/v8_dictionary.py b/Source/bindings/scripts/v8_dictionary.py
index 3010c9fa5e958d29572f238e8f6eff856c410f92..cd9b48463bce1003ba7147f286b7c2c367ab67bc 100644
--- a/Source/bindings/scripts/v8_dictionary.py
+++ b/Source/bindings/scripts/v8_dictionary.py
@@ -165,6 +165,7 @@ def dictionary_impl_context(dictionary, interfaces_info):
def member_impl_context(member, interfaces_info, header_includes):
idl_type = unwrap_nullable_if_needed(member.idl_type)
+ is_any = idl_type.name == 'Any'
is_object = idl_type.name == 'Object'
haraken 2015/05/18 01:59:44 Do we need to distinguish is_any from is_object?
bashi 2015/05/20 00:22:01 No. Actually, we don't need to put |is_any| and |i
cpp_name = v8_utilities.cpp_name(member)
@@ -176,7 +177,7 @@ def member_impl_context(member, interfaces_info, header_includes):
def has_method_expression():
if idl_type.impl_should_use_nullable_container or idl_type.is_enum or idl_type.is_string_type or idl_type.is_union_type:
return '!m_%s.isNull()' % cpp_name
- elif is_object:
+ elif is_object or is_any:
return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(cpp_name)
else:
return 'm_%s' % cpp_name
@@ -198,6 +199,7 @@ def member_impl_context(member, interfaces_info, header_includes):
'getter_expression': getter_expression(),
'has_method_expression': has_method_expression(),
'has_method_name': has_method_name_for_dictionary_member(member),
+ 'is_any': is_any,
'is_object': is_object,
'is_traceable': idl_type.is_traceable,
'member_cpp_type': member_cpp_type(),

Powered by Google App Engine
This is Rietveld 408576698