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

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

Issue 700093002: IDL: Support nullable union types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/scripts/idl_types.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 944db4a604f6a029d45528807efeb4a48f8c9696..944fecef0eea2b7224a10122553a97e9c505e724 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -193,7 +193,7 @@ def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_
if idl_type.is_dictionary:
return base_idl_type
if idl_type.is_union_type:
- return idl_type.name
+ return idl_type.as_union_type.name
# Default, assume native type is a pointer with same type name as idl type
return base_idl_type + '*'
@@ -517,7 +517,7 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name
# Simple types
idl_type = idl_type.preprocessed_type
add_includes_for_type(idl_type)
- base_idl_type = idl_type.name if idl_type.is_union_type else idl_type.base_type
+ base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else idl_type.base_type
if 'EnforceRange' in extended_attributes:
arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
@@ -862,7 +862,8 @@ def cpp_type_has_null_value(idl_type):
# a null pointer.
# - 'Object' type. We use ScriptValue for object type.
return (idl_type.is_string_type or idl_type.is_wrapper_type or
- idl_type.is_enum or idl_type.base_type == 'object')
+ idl_type.is_enum or idl_type.is_union_type or
+ idl_type.base_type == 'object')
IdlTypeBase.cpp_type_has_null_value = property(cpp_type_has_null_value)
« no previous file with comments | « Source/bindings/scripts/idl_types.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698