aboutsummaryrefslogtreecommitdiffstats
path: root/third_party/WebIDL/union-typedef.patch
blob: 20efea8e129c93f882509da7eac1970adf688446 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- WebIDL.py
+++ WebIDL.py
@@ -2624,10 +2624,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):