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.
This commit is contained in:
Ms2ger 2014-12-20 13:46:16 +01:00
parent e1dae2f59b
commit b8c2573f4d
3 changed files with 8 additions and 17 deletions

View file

@ -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}