mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Inline dataLoc in the one place that can see it and the one place that can't.
This commit is contained in:
parent
eab9fd765c
commit
8b5778993a
1 changed files with 4 additions and 5 deletions
|
@ -1255,7 +1255,6 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
else:
|
else:
|
||||||
assert(defaultValue is None or
|
assert(defaultValue is None or
|
||||||
not isinstance(defaultValue, IDLNullValue))
|
not isinstance(defaultValue, IDLNullValue))
|
||||||
dataLoc = "${declName}"
|
|
||||||
#XXXjdm conversionBehavior should be used
|
#XXXjdm conversionBehavior should be used
|
||||||
successVal = "v"
|
successVal = "v"
|
||||||
if preSuccess or postSuccess:
|
if preSuccess or postSuccess:
|
||||||
|
@ -1263,8 +1262,8 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
template = (
|
template = (
|
||||||
"match JSValConvertible::from_jsval(cx, ${val}) {\n"
|
"match JSValConvertible::from_jsval(cx, ${val}) {\n"
|
||||||
" Err(_) => %s,\n"
|
" Err(_) => %s,\n"
|
||||||
" Ok(v) => %s = %s\n"
|
" Ok(v) => ${declName} = %s\n"
|
||||||
"}" % (failureCode, dataLoc, successVal))
|
"}" % (failureCode, successVal))
|
||||||
declType = CGGeneric(typeName)
|
declType = CGGeneric(typeName)
|
||||||
if (defaultValue is not None and
|
if (defaultValue is not None and
|
||||||
# We already handled IDLNullValue, so just deal with the other ones
|
# 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",
|
pre="if ${haveValue} {\n",
|
||||||
post=("\n"
|
post=("\n"
|
||||||
"} else {\n"
|
"} else {\n"
|
||||||
" %s = %s;\n"
|
" ${declName} = %s;\n"
|
||||||
"}" % (dataLoc, defaultStr))).define()
|
"}" % defaultStr)).define()
|
||||||
|
|
||||||
initialVal = "false" if typeName == "bool" else ("0 as %s" % typeName)
|
initialVal = "false" if typeName == "bool" else ("0 as %s" % typeName)
|
||||||
if type.nullable():
|
if type.nullable():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue