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

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

Issue 466323002: IDL: Use Nullable for union type return value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/core/v8/Nullable.h ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 6f3b7fe078f37e421b5b6c2823fd571b381de154..606381a248b8113d6534d61542be0a168f87cf0e 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -934,8 +934,10 @@ def interface_length(interface, constructors):
def property_getter(getter, cpp_arguments):
def is_null_expression(idl_type):
if idl_type.is_union_type:
- return ' && '.join('!result%sEnabled' % i
- for i, _ in enumerate(idl_type.member_types))
+ notnull = ' || '.join([
+ member_argument['null_check_value']
+ for member_argument in idl_type.union_arguments])
+ return '!(%s)' % notnull
if idl_type.name == 'String':
return 'result.isNull()'
if idl_type.is_interface_type:
@@ -953,7 +955,8 @@ def property_getter(getter, cpp_arguments):
cpp_arguments.append('exceptionState')
union_arguments = idl_type.union_arguments
if union_arguments:
- cpp_arguments.extend(union_arguments)
+ cpp_arguments.extend([member_argument['cpp_value']
+ for member_argument in union_arguments])
cpp_value = '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
« no previous file with comments | « Source/bindings/core/v8/Nullable.h ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698