mirror of
https://github.com/servo/servo.git
synced 2025-06-13 10:54:29 +00:00
Fix the double indentation in CastableObjectUnwrapper.
The current code indents the first line of codeOnFailure four spaces too far.
This commit is contained in:
parent
e7c2329649
commit
db3078fde4
1 changed files with 9 additions and 7 deletions
|
@ -101,19 +101,21 @@ class CastableObjectUnwrapper():
|
|||
codeOnFailure is the code to run if unwrapping fails.
|
||||
"""
|
||||
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()}
|
||||
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}) {
|
||||
Ok(val) => val,
|
||||
Err(()) => {
|
||||
${codeOnFailure}
|
||||
${codeOnFailure}
|
||||
}
|
||||
}""").substitute(self.substitution)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue