mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01: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.
|
codeOnFailure is the code to run if unwrapping fails.
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor, source, codeOnFailure):
|
def __init__(self, descriptor, source, codeOnFailure):
|
||||||
self.substitution = { "type" : descriptor.nativeType,
|
self.substitution = {
|
||||||
|
"type": descriptor.nativeType,
|
||||||
"depth": descriptor.interface.inheritanceDepth(),
|
"depth": descriptor.interface.inheritanceDepth(),
|
||||||
"prototype": "PrototypeList::id::" + descriptor.name,
|
"prototype": "PrototypeList::id::" + descriptor.name,
|
||||||
"protoID" : "PrototypeList::id::" + descriptor.name + " as uint",
|
"protoID": "PrototypeList::id::" + descriptor.name + " as uint",
|
||||||
"source" : source,
|
"source": source,
|
||||||
"codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define()}
|
"codeOnFailure": CGIndenter(CGGeneric(codeOnFailure), 4).define(),
|
||||||
|
}
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return string.Template(
|
return string.Template(
|
||||||
"""match unwrap_jsmanaged(${source}, ${prototype}, ${depth}) {
|
"""match unwrap_jsmanaged(${source}, ${prototype}, ${depth}) {
|
||||||
Ok(val) => val,
|
Ok(val) => val,
|
||||||
Err(()) => {
|
Err(()) => {
|
||||||
${codeOnFailure}
|
${codeOnFailure}
|
||||||
}
|
}
|
||||||
}""").substitute(self.substitution)
|
}""").substitute(self.substitution)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue