aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 71331dfe503..717fc4a4cf2 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2134,7 +2134,7 @@ class CGCallbackTempRoot(CGGeneric):
CGGeneric.__init__(self, "%s::new(${val}.get().to_object())" % name)
-def getAllTypes(descriptors, dictionaries, callbacks):
+def getAllTypes(descriptors, dictionaries, callbacks, typedefs):
"""
Generate all the types we're dealing with. For each type, a tuple
containing type, descriptor, dictionary is yielded. The
@@ -2150,9 +2150,11 @@ def getAllTypes(descriptors, dictionaries, callbacks):
for callback in callbacks:
for t in getTypesFromCallback(callback):
yield (t, None, None)
+ for typedef in typedefs:
+ yield (typedef.innerType, None, None)
-def UnionTypes(descriptors, dictionaries, callbacks, config):
+def UnionTypes(descriptors, dictionaries, callbacks, typedefs, config):
"""
Returns a CGList containing CGUnionStructs for every union.
"""
@@ -2181,7 +2183,7 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
# Now find all the things we'll need as arguments and return values because
# we need to wrap or unwrap them.
unionStructs = dict()
- for (t, descriptor, dictionary) in getAllTypes(descriptors, dictionaries, callbacks):
+ for (t, descriptor, dictionary) in getAllTypes(descriptors, dictionaries, callbacks, typedefs):
assert not descriptor or not dictionary
t = t.unroll()
if not t.isUnion():
@@ -6914,6 +6916,7 @@ impl %(base)s {
curr = UnionTypes(config.getDescriptors(),
config.getDictionaries(),
config.getCallbacks(),
+ config.typedefs,
config)
# Add the auto-generated comment.