mirror of
https://github.com/servo/servo.git
synced 2025-06-11 01:50:10 +00:00
Assign into the argument binding directly in instantiateJSToNativeConversionTemplate.
This commit is contained in:
parent
aed95dfd94
commit
262dc30c18
1 changed files with 11 additions and 9 deletions
|
@ -831,17 +831,19 @@ def instantiateJSToNativeConversionTemplate(templateTuple, replacements,
|
||||||
CGGeneric("None"))
|
CGGeneric("None"))
|
||||||
|
|
||||||
if declType is not None:
|
if declType is not None:
|
||||||
newDecl = [CGGeneric("let mut "),
|
newDecl = [
|
||||||
|
CGGeneric("let mut "),
|
||||||
CGGeneric(replacements["declName"]),
|
CGGeneric(replacements["declName"]),
|
||||||
CGGeneric(": "),
|
CGGeneric(": "),
|
||||||
declType]
|
declType,
|
||||||
newDecl.append(CGGeneric(";"))
|
CGGeneric(" = "),
|
||||||
|
conversion,
|
||||||
|
CGGeneric(";"),
|
||||||
|
]
|
||||||
result.append(CGList(newDecl))
|
result.append(CGList(newDecl))
|
||||||
conversion = CGWrapper(conversion,
|
else:
|
||||||
pre="%s = " % replacements["declName"],
|
|
||||||
post=";")
|
|
||||||
|
|
||||||
result.append(conversion)
|
result.append(conversion)
|
||||||
|
|
||||||
# Add an empty CGGeneric to get an extra newline after the argument
|
# Add an empty CGGeneric to get an extra newline after the argument
|
||||||
# conversion.
|
# conversion.
|
||||||
result.append(CGGeneric(""))
|
result.append(CGGeneric(""))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue