aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-05-03 13:40:02 +0200
committerMs2ger <ms2ger@gmail.com>2014-05-05 11:21:13 +0200
commite53c768b9ef765700d40fc153b295d7630f30baf (patch)
tree5c8879b78af79ff9ab3fa7d9fbcdc2012d13758b /src/components/script
parent2db1ce72f0d2713d8f332514afd1ba8061cf3926 (diff)
downloadservo-e53c768b9ef765700d40fc153b295d7630f30baf.tar.gz
servo-e53c768b9ef765700d40fc153b295d7630f30baf.zip
Use CGIfWrapper in instantiateJSToNativeConversionTemplate.
Diffstat (limited to 'src/components/script')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 02e7071158d..0a0eb3b19eb 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -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