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

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

Issue 338893004: Extend ScalarValueString handling to include constructors. (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/bindings/scripts/v8_interface.py » ('j') | Source/bindings/scripts/v8_interface.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/idl_types.py
diff --git a/Source/bindings/scripts/idl_types.py b/Source/bindings/scripts/idl_types.py
index e488e33264830157b37294bf42dd24c86ce5ac9d..1d1d4ae1cc6c2705107b6ef00f47c94ce81e1ad9 100644
--- a/Source/bindings/scripts/idl_types.py
+++ b/Source/bindings/scripts/idl_types.py
@@ -70,6 +70,14 @@ TYPE_NAMES = {
'Date': 'Date',
}
+STRING_TYPES = frozenset([
+ # http://heycam.github.io/webidl/, Section 4.5.1.1.10.11 (Interface object [[Call]] method)
+ 'String',
+ 'ByteString',
+ 'ScalarValueString',
+])
+
+
jsbell 2014/06/19 20:49:19 Nit: remove one of these blank lines
sof 2014/06/20 07:21:16 Done.
################################################################################
# Inheritance
@@ -195,6 +203,15 @@ class IdlType(object):
self.name == 'Promise') # Promise will be basic in future
@property
+ def is_string_type(self):
+ return self.name in STRING_TYPES
+
+ @property
+ def may_raise_exception_on_conversion(self):
jsbell 2014/06/19 20:49:19 We may want to refactor the conversions even furth
jsbell 2014/06/19 20:50:26 ... but that should be a follow-up CL.
+ return (self.is_integer_type or
+ self.name in ('ByteString', 'ScalarValueString'))
+
+ @property
def is_union_type(self):
return isinstance(self, IdlUnionType)
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | Source/bindings/scripts/v8_interface.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698