Now that ?= is optimized, reverting the expansion.

This commit is contained in:
Jeremy Ashkenas
2010-11-01 22:04:22 -04:00
parent 83e6955dce
commit f13e363a87
2 changed files with 2 additions and 6 deletions

View File

@@ -1069,7 +1069,7 @@
} else {
ref = param;
if (param.value) {
exprs.push(new Op('||', new Literal("" + param.name.value + " != null"), new Assign(param.name, param.value)));
exprs.push(new Assign(new Value(param.name), param.value, '?='));
}
}
if (!splats) {

View File

@@ -882,11 +882,7 @@ exports.Code = class Code extends Base
if param.value then new Op '?', ref, param.value else ref
else
ref = param
if param.value
exprs.push new Op('||',
new Literal("#{param.name.value} != null"),
new Assign(param.name, param.value)
)
exprs.push new Assign new Value(param.name), param.value, '?=' if param.value
vars.push ref unless splats
scope.startLevel()
wasEmpty = @body.isEmpty()