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) |