mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +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=";")
|
||||
|
||||
if argcAndIndex is not None:
|
||||
declConstruct = None
|
||||
holderConstruct = None
|
||||
|
||||
conversion = CGList(
|
||||
[CGGeneric(
|
||||
string.Template("if ${index} < ${argc} {").substitute(
|
||||
argcAndIndex
|
||||
)),
|
||||
declConstruct,
|
||||
holderConstruct,
|
||||
CGIndenter(conversion),
|
||||
CGGeneric("}")],
|
||||
"\n")
|
||||
condition = string.Template("${index} < ${argc}").substitute(argcAndIndex)
|
||||
conversion = CGIfWrapper(conversion, condition)
|
||||
|
||||
result.append(conversion)
|
||||
# Add an empty CGGeneric to get an extra newline after the argument
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue