diff options
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index f1b239a1922..31c3af4e6be 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -918,7 +918,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None, assert not type.treatNonObjectAsNull() or type.nullable() assert not type.treatNonObjectAsNull() or not type.treatNonCallableAsNull() - declType = CGGeneric('%s::%s' % (type.unroll().module(), type.unroll().identifier.name)) + callback = type.unroll().callback + declType = CGGeneric('%s::%s' % (callback.module(), callback.identifier.name)) finalDeclType = CGTemplatedType("Rc", declType) conversion = CGCallbackTempRoot(declType.define()) @@ -1285,8 +1286,8 @@ def getRetvalDeclarationForType(returnType, descriptorProvider): result = CGWrapper(result, pre="Option<", post=">") return result if returnType.isCallback(): - result = CGGeneric('Rc<%s::%s>' % (returnType.unroll().module(), - returnType.unroll().identifier.name)) + callback = returnType.unroll().callback + result = CGGeneric('Rc<%s::%s>' % (callback.module(), callback.identifier.name)) if returnType.nullable(): result = CGWrapper(result, pre="Option<", post=">") return result @@ -4936,7 +4937,7 @@ class CGBindingRoot(CGThing): # Do codegen for all the callback interfaces. cgthings.extend(CGList([CGCallbackInterface(x), - CGCallbackFunctionImpl(x)], "\n") + CGCallbackFunctionImpl(x.interface)], "\n") for x in callbackDescriptors) # And make sure we have the right number of newlines at the end @@ -5259,7 +5260,7 @@ impl ToJSValConvertible for ${type} { self.callback().to_jsval(cx, rval); } }\ -""").substitute({"type": callback.name}) +""").substitute({"type": callback.identifier.name}) CGGeneric.__init__(self, impl) @@ -5688,7 +5689,7 @@ class GlobalGenRoots(): def Bindings(config): descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) | - set(d.unroll().module() for d in config.callbacks) | + set(d.module() for d in config.callbacks) | set(d.module() for d in config.getDictionaries())) curr = CGList([CGGeneric("pub mod %s;\n" % name) for name in sorted(descriptors)]) curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) |