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

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

Issue 368313005: IDL: Add support for [TreatNullAs=EmptyString] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix debug compilation 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
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 8508ad81728eec92599480f46aeca2e2609fc9fa..efa460c8906b36f02a24e3d99b73a3714a195eb6 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -138,12 +138,12 @@ 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():
- # FIXME: the Web IDL spec requires 'EmptyString', not 'NullString',
- # but we use NullString for performance.
+ if extended_attributes.get('TreatNullAs') == 'EmptyString':
+ return 'TreatNullAsEmptyString'
if idl_type.is_nullable or extended_attributes.get('TreatNullAs') == 'NullString':
if extended_attributes.get('TreatUndefinedAs') == 'NullString':
- return 'WithUndefinedOrNullCheck'
- return 'WithNullCheck'
+ return 'TreatNullAndUndefinedAsNullString'
+ return 'TreatNullAsNullString'
return ''
extended_attributes = extended_attributes or {}
« no previous file with comments | « Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp ('k') | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698