aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/parser
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2016-09-07 21:45:54 -0700
committerKeith Yeung <kungfukeith11@gmail.com>2016-09-07 21:48:46 -0700
commit3976d974fc8cd79894fe876429d44fc3c88229f2 (patch)
tree9066e8e0eb1ace7c29081109b3adda9fe1a0196e /components/script/dom/bindings/codegen/parser
parent3631e314b93746e04944de9f9b77b994420b0bf6 (diff)
downloadservo-3976d974fc8cd79894fe876429d44fc3c88229f2.tar.gz
servo-3976d974fc8cd79894fe876429d44fc3c88229f2.zip
Properly generate typedef identities in unions
Diffstat (limited to 'components/script/dom/bindings/codegen/parser')
-rw-r--r--components/script/dom/bindings/codegen/parser/WebIDL.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/components/script/dom/bindings/codegen/parser/WebIDL.py b/components/script/dom/bindings/codegen/parser/WebIDL.py
index 21af299303e..878c221f01c 100644
--- a/components/script/dom/bindings/codegen/parser/WebIDL.py
+++ b/components/script/dom/bindings/codegen/parser/WebIDL.py
@@ -2491,10 +2491,18 @@ class IDLUnionType(IDLType):
return type.name
for (i, type) in enumerate(self.memberTypes):
- if not type.isComplete():
+ # Exclude typedefs because if given "typedef (B or C) test",
+ # we want AOrTest, not AOrBOrC
+ if not type.isComplete() and not isinstance(type, IDLTypedefType):
self.memberTypes[i] = type.complete(scope)
self.name = "Or".join(typeName(type) for type in self.memberTypes)
+
+ # We do this again to complete the typedef types
+ for (i, type) in enumerate(self.memberTypes):
+ if not type.isComplete():
+ self.memberTypes[i] = type.complete(scope)
+
self.flatMemberTypes = list(self.memberTypes)
i = 0
while i < len(self.flatMemberTypes):