Assign into the argument binding directly in instantiateJSToNativeConversionTemplate.

This commit is contained in:
Ms2ger 2014-05-03 15:18:53 +02:00
parent aed95dfd94
commit 262dc30c18

View file

@ -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(""))