aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-12-20 13:46:16 +0100
committerMs2ger <ms2ger@gmail.com>2014-12-20 13:48:21 +0100
commitb8c2573f4d7500561790428800a777deb56323c9 (patch)
tree45666a229515b9bb9065519ebd8bf37b9f682eb7 /components/script/dom/bindings/codegen/CodegenRust.py
parente1dae2f59b41d9816be367f765ff3afb9abf7f06 (diff)
downloadservo-b8c2573f4d7500561790428800a777deb56323c9.tar.gz
servo-b8c2573f4d7500561790428800a777deb56323c9.zip
Remove the proto_{id,depth} arguments from unwrap_jsmanaged.
Instead, we infer them from the type we're unwrapping into. This will prevent any mismatches between the type we return and the type we check for.
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index b34c6441b70..28e1b439775 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -102,17 +102,13 @@ class CastableObjectUnwrapper():
"""
def __init__(self, descriptor, source, codeOnFailure):
self.substitution = {
- "type": descriptor.nativeType,
- "depth": descriptor.interface.inheritanceDepth(),
- "prototype": "PrototypeList::ID::" + descriptor.name,
- "protoID": "PrototypeList::ID::" + descriptor.name + " as uint",
"source": source,
"codeOnFailure": CGIndenter(CGGeneric(codeOnFailure), 4).define(),
}
def __str__(self):
return string.Template(
-"""match unwrap_jsmanaged(${source}, ${prototype}, ${depth}) {
+"""match unwrap_jsmanaged(${source}) {
Ok(val) => val,
Err(()) => {
${codeOnFailure}