aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-03-06 22:20:47 +0100
committerMs2ger <ms2ger@gmail.com>2014-03-06 22:20:47 +0100
commit8b5778993ab7500ad109e77b899698cdef771a60 (patch)
tree333a3b2ebe9b3ae6597777f6cf80615b027b03e3 /src/components/script/dom/bindings/codegen/CodegenRust.py
parenteab9fd765ca2bbeb1a05b0f74375b231fb367d85 (diff)
downloadservo-8b5778993ab7500ad109e77b899698cdef771a60.tar.gz
servo-8b5778993ab7500ad109e77b899698cdef771a60.zip
Inline dataLoc in the one place that can see it and the one place that can't.
Diffstat (limited to 'src/components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index b9bd9a54ae8..70fa8e6515c 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -1255,7 +1255,6 @@ for (uint32_t i = 0; i < length; ++i) {
else:
assert(defaultValue is None or
not isinstance(defaultValue, IDLNullValue))
- dataLoc = "${declName}"
#XXXjdm conversionBehavior should be used
successVal = "v"
if preSuccess or postSuccess:
@@ -1263,8 +1262,8 @@ for (uint32_t i = 0; i < length; ++i) {
template = (
"match JSValConvertible::from_jsval(cx, ${val}) {\n"
" Err(_) => %s,\n"
- " Ok(v) => %s = %s\n"
- "}" % (failureCode, dataLoc, successVal))
+ " Ok(v) => ${declName} = %s\n"
+ "}" % (failureCode, successVal))
declType = CGGeneric(typeName)
if (defaultValue is not None and
# We already handled IDLNullValue, so just deal with the other ones
@@ -1279,8 +1278,8 @@ for (uint32_t i = 0; i < length; ++i) {
pre="if ${haveValue} {\n",
post=("\n"
"} else {\n"
- " %s = %s;\n"
- "}" % (dataLoc, defaultStr))).define()
+ " ${declName} = %s;\n"
+ "}" % defaultStr)).define()
initialVal = "false" if typeName == "bool" else ("0 as %s" % typeName)
if type.nullable():