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

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

Issue 338843005: IDL: For DOMString? attribute getters, use null string to represent null (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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_attributes.py
diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py
index 90abceaea86ef5e4c127744a1098525f6259d1d1..c9d64402af6f4b457c2bf1ca0e35970a4825b631 100644
--- a/Source/bindings/scripts/v8_attributes.py
+++ b/Source/bindings/scripts/v8_attributes.py
@@ -77,6 +77,11 @@ def attribute_context(interface, attribute):
attribute.name == 'onerror'):
includes.add('bindings/v8/V8ErrorHandler.h')
+ # Nullable type where the corresponding C++ type supports a null value.
+ is_nullable_simple = idl_type.is_nullable and (
+ (idl_type.is_string_type or idl_type.is_wrapper_type) and
+ not idl_type.array_or_sequence_type)
+
context = {
'access_control_list': access_control_list(attribute),
'activity_logging_world_list_for_getter': v8_utilities.activity_logging_world_list(attribute, 'Getter'), # [ActivityLogging]
@@ -108,7 +113,7 @@ def attribute_context(interface, attribute):
'InitializedByEventConstructor' in extended_attributes,
'is_keep_alive_for_gc': is_keep_alive_for_gc(interface, attribute),
'is_nullable': idl_type.is_nullable,
- 'is_nullable_simple': idl_type.is_nullable and idl_type.is_wrapper_type, # null value maps to C++ null pointer
+ 'is_nullable_simple': is_nullable_simple,
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestObject.cpp » ('j') | Source/bindings/tests/results/V8TestObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698