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

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

Issue 384773004: IDL clean-up: Rename is_nullable_simple => is_implicit_nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-nullable-method-return-type
Patch Set: order, order Created 6 years, 5 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/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('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 b3de551a046925d0934b46b7fc82b22bae4b2bcc..46b005222f31cbda0999e237c8251aaa55bd2d2f 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -723,7 +723,12 @@ def literal_cpp_value(idl_type, idl_literal):
IdlType.literal_cpp_value = literal_cpp_value
-def is_nullable_simple(idl_type):
+################################################################################
+# Utility properties for nullable types
+################################################################################
+
+
+def is_implicit_nullable(idl_type):
# Nullable type where the corresponding C++ type supports a null value.
# - String types (String/AtomicString) represent null as a null string,
# i.e. one for which String::isNull() returns true.
@@ -733,5 +738,13 @@ def is_nullable_simple(idl_type):
(idl_type.is_string_type or idl_type.is_wrapper_type) and
not idl_type.native_array_element_type)
-IdlType.is_nullable_simple = property(is_nullable_simple)
-IdlUnionType.is_nullable_simple = False
+
+def is_explicit_nullable(idl_type):
+ # Nullable type that isn't implicit nullable (see above.) For such types,
+ # we use Nullable<T> or similar explicit ways to represent a null value.
+ return idl_type.is_nullable and not idl_type.is_implicit_nullable
+
+IdlType.is_implicit_nullable = property(is_implicit_nullable)
+IdlType.is_explicit_nullable = property(is_explicit_nullable)
+IdlUnionType.is_implicit_nullable = False
+IdlUnionType.is_explicit_nullable = property(is_explicit_nullable)
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698