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