mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Properly keep track of our union typedef support in WebIDL.py
This commit is contained in:
parent
f763eca344
commit
4c084cefa3
2 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
--- WebIDL.py
|
||||
+++ WebIDL.py
|
||||
@@ -2481,10 +2481,18 @@ class IDLUnionType(IDLType):
|
||||
return type.name
|
||||
|
||||
for (i, type) in enumerate(self.memberTypes):
|
||||
+ # 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.name = "Or".join(typeName(type) for type in self.memberTypes)
|
||||
self.flatMemberTypes = list(self.memberTypes)
|
||||
i = 0
|
||||
while i < len(self.flatMemberTypes):
|
|
@ -4,6 +4,7 @@ patch < debug.patch
|
|||
patch < pref-main-thread.patch
|
||||
patch < callback-location.patch
|
||||
patch < bytestring.patch
|
||||
patch < union-typedef.patch
|
||||
|
||||
wget https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/ -O tests.tar.gz
|
||||
rm -r tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue