mirror of
https://github.com/servo/servo.git
synced 2025-06-10 01:23:13 +00:00
Use CGIfWrapper in instantiateJSToNativeConversionTemplate.
This commit is contained in:
parent
2db1ce72f0
commit
e53c768b9e
1 changed files with 2 additions and 13 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue