Use CGIfWrapper in instantiateJSToNativeConversionTemplate.

This commit is contained in:
Ms2ger 2014-05-03 13:40:02 +02:00
parent 2db1ce72f0
commit e53c768b9e

View file

@ -868,19 +868,8 @@ def instantiateJSToNativeConversionTemplate(templateTuple, replacements,
post=";") post=";")
if argcAndIndex is not None: if argcAndIndex is not None:
declConstruct = None condition = string.Template("${index} < ${argc}").substitute(argcAndIndex)
holderConstruct = None conversion = CGIfWrapper(conversion, condition)
conversion = CGList(
[CGGeneric(
string.Template("if ${index} < ${argc} {").substitute(
argcAndIndex
)),
declConstruct,
holderConstruct,
CGIndenter(conversion),
CGGeneric("}")],
"\n")
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