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

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

Issue 367003002: Make more [TreatNullAs=NullString] DOMString arguments nullable (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
« no previous file with comments | « no previous file | Source/core/dom/Document.idl » ('j') | Source/core/dom/Document.idl » ('J')
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 5cce99914b0f17c5b10af91acb4bc664e86439f0..746dde3da43e1e3b3d409439c2c1331c0f97dc3c 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -138,15 +138,13 @@ def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_argumen
bool, True if the C++ type is used as an element of an array or sequence.
"""
def string_mode():
- if idl_type.is_nullable:
- return 'WithNullCheck'
# FIXME: the Web IDL spec requires 'EmptyString', not 'NullString',
# but we use NullString for performance.
- if extended_attributes.get('TreatNullAs') != 'NullString':
- return ''
- if extended_attributes.get('TreatUndefinedAs') != 'NullString':
+ if idl_type.is_nullable or extended_attributes.get('TreatNullAs') == 'NullString':
+ if extended_attributes.get('TreatUndefinedAs') == 'NullString':
+ return 'WithUndefinedOrNullCheck'
return 'WithNullCheck'
- return 'WithUndefinedOrNullCheck'
+ return ''
extended_attributes = extended_attributes or {}
idl_type = idl_type.preprocessed_type
« no previous file with comments | « no previous file | Source/core/dom/Document.idl » ('j') | Source/core/dom/Document.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698