mirror of
https://github.com/servo/servo.git
synced 2025-06-09 09:03:23 +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"))
|
||||
|
||||
if declType is not None:
|
||||
newDecl = [CGGeneric("let mut "),
|
||||
CGGeneric(replacements["declName"]),
|
||||
CGGeneric(": "),
|
||||
declType]
|
||||
newDecl.append(CGGeneric(";"))
|
||||
newDecl = [
|
||||
CGGeneric("let mut "),
|
||||
CGGeneric(replacements["declName"]),
|
||||
CGGeneric(": "),
|
||||
declType,
|
||||
CGGeneric(" = "),
|
||||
conversion,
|
||||
CGGeneric(";"),
|
||||
]
|
||||
result.append(CGList(newDecl))
|
||||
conversion = CGWrapper(conversion,
|
||||
pre="%s = " % replacements["declName"],
|
||||
post=";")
|
||||
else:
|
||||
result.append(conversion)
|
||||
|
||||
result.append(conversion)
|
||||
# Add an empty CGGeneric to get an extra newline after the argument
|
||||
# conversion.
|
||||
result.append(CGGeneric(""))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue