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

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

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 889dc5bd48a9222255d57a97d20ae8cc0cab1746..b010594f2632a97ccab34831f4c24529ed68d170 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -1045,10 +1045,7 @@ def interface_length(interface, constructors):
def property_getter(getter, cpp_arguments):
def is_null_expression(idl_type):
if idl_type.is_union_type:
haraken 2014/10/29 04:59:30 Don't we need to check idl_type.is_dictionary_type
bashi 2014/10/29 09:57:36 Done. (Though I'm not sure we already support dict
- notnull = ' || '.join([
- member_argument['null_check_value']
- for member_argument in idl_type.union_arguments])
- return '!(%s)' % notnull
+ return 'result.isNull()'
if idl_type.name == 'String':
return 'result.isNull()'
if idl_type.is_interface_type:
@@ -1064,10 +1061,8 @@ def property_getter(getter, cpp_arguments):
if is_raises_exception:
cpp_arguments.append('exceptionState')
- union_arguments = idl_type.union_arguments
- if union_arguments:
- cpp_arguments.extend([member_argument['cpp_value']
- for member_argument in union_arguments])
+ if idl_type.is_union_type:
haraken 2014/10/29 04:59:30 Ditto.
bashi 2014/10/29 09:57:36 Done.
+ cpp_arguments.append('result')
cpp_value = '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
@@ -1086,7 +1081,7 @@ def property_getter(getter, cpp_arguments):
'is_null_expression': is_null_expression(idl_type),
'is_raises_exception': is_raises_exception,
'name': cpp_name(getter),
- 'union_arguments': union_arguments,
+ 'use_output_parameter_for_result': v8_methods.use_output_parameter_for_result(idl_type),
'v8_set_return_value': idl_type.v8_set_return_value('result', extended_attributes=extended_attributes, script_wrappable='impl', release=idl_type.release),
}

Powered by Google App Engine
This is Rietveld 408576698