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

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

Issue 1316833003: bindings: Support (deprecated) Dictionary in IDL dictionary (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 36129b552e2688af954c900efa4b5596a7391b66..0f4ba1669bf8b370a7b8b20bd8fbc5f4a39ec2a2 100644
--- a/Source/bindings/scripts/v8_dictionary.py
+++ b/Source/bindings/scripts/v8_dictionary.py
@@ -99,6 +99,7 @@ def member_context(dictionary, member):
cpp_default_value, v8_default_value = default_values()
cpp_name = v8_utilities.cpp_name(member)
+ is_deprecated_dictionary = unwrapped_idl_type.name == 'Dictionary'
return {
'cpp_default_value': cpp_default_value,
@@ -113,7 +114,8 @@ def member_context(dictionary, member):
'enum_values': unwrapped_idl_type.enum_values,
'has_method_name': has_method_name_for_dictionary_member(member),
'idl_type': idl_type.base_type,
- 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dictionary,
+ 'is_deprecated_dictionary': is_deprecated_dictionary,
+ 'is_interface_type': idl_type.is_interface_type and not (idl_type.is_dictionary_type or is_deprecated_dictionary),
'is_nullable': idl_type.is_nullable,
'is_object': unwrapped_idl_type.name == 'Object',
haraken 2015/08/26 00:40:54 Maybe it would be better to change this to: 'is
bashi 2015/08/26 00:48:14 Done.
'is_required': member.is_required,
@@ -177,6 +179,8 @@ def member_impl_context(member, interfaces_info, header_includes):
return '!m_%s.isNull()' % cpp_name
elif idl_type.name in ['Any', 'Object']:
return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(cpp_name)
+ elif idl_type.name == 'Dictionary':
+ return '!m_%s.isUndefinedOrNull()' % cpp_name
else:
return 'm_%s' % cpp_name
« no previous file with comments | « LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt ('k') | Source/bindings/templates/dictionary_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698