aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/Configuration.py
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2017-11-06 22:52:40 -0800
committerKeith Yeung <kungfukeith11@gmail.com>2017-11-08 04:20:30 -0800
commitce8486ab9b3af974a7c738a08a9da460360ce117 (patch)
tree22ad3650e2def68cfc81dab4376d6f90ef72ea54 /components/script/dom/bindings/codegen/Configuration.py
parent4decea188feb87b880fd2b0663b86d262a346a18 (diff)
downloadservo-ce8486ab9b3af974a7c738a08a9da460360ce117.tar.gz
servo-ce8486ab9b3af974a7c738a08a9da460360ce117.zip
Import sequence inner types if it appears in dictionary members
Diffstat (limited to 'components/script/dom/bindings/codegen/Configuration.py')
-rw-r--r--components/script/dom/bindings/codegen/Configuration.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py
index 56141e52b09..0ab27151bb6 100644
--- a/components/script/dom/bindings/codegen/Configuration.py
+++ b/components/script/dom/bindings/codegen/Configuration.py
@@ -4,7 +4,7 @@
import os
-from WebIDL import IDLExternalInterface, IDLWrapperType, WebIDLError
+from WebIDL import IDLExternalInterface, IDLSequenceType, IDLWrapperType, WebIDLError
class Configuration:
@@ -457,7 +457,7 @@ def getTypesFromDictionary(dictionary):
types = []
curDict = dictionary
while curDict:
- types.extend([m.type for m in curDict.members])
+ types.extend([getUnwrappedType(m.type) for m in curDict.members])
curDict = curDict.parent
return types
@@ -473,6 +473,12 @@ def getTypesFromCallback(callback):
return types
+def getUnwrappedType(type):
+ while isinstance(type, IDLSequenceType):
+ type = type.inner
+ return type
+
+
def iteratorNativeType(descriptor, infer=False):
assert descriptor.interface.isIterable()
iterableDecl = descriptor.interface.maplikeOrSetlikeOrIterable