quit caching v in for all k of v

This commit is contained in:
satyr
2010-10-07 15:31:40 +09:00
parent 250ec12646
commit c7157ca90c
5 changed files with 16 additions and 27 deletions

View File

@@ -1593,19 +1593,16 @@
exports.For = (function() {
For = (function() {
return function For(_arg, source, _arg2, _arg3) {
var _ref2;
var _ref2, _ref3;
this.index = _arg3;
this.name = _arg2;
this.body = _arg;
For.__super__.constructor.call(this);
this.index || (this.index = null);
this.source = source.source;
this.guard = source.guard;
this.step = source.step;
_ref2 = source, this.source = _ref2.source, this.guard = _ref2.guard, this.step = _ref2.step;
this.raw = !!source.raw;
this.object = !!source.object;
if (this.object) {
_ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
_ref3 = [this.index, this.name], this.name = _ref3[0], this.index = _ref3[1];
}
this.pattern = this.name instanceof Value;
if (this.index instanceof Value) {
@@ -1670,12 +1667,10 @@
step: this.step
}));
} else {
svar = this.source.compile(o);
if (IDENTIFIER.test(svar) && scope.check(svar, {
svar = (sourcePart = this.source.compile(o));
if ((name || !this.raw) && !(IDENTIFIER.test(svar) && scope.check(svar, {
immediate: true
})) {
sourcePart = svar;
} else {
}))) {
sourcePart = ("" + (ref = scope.freeVariable('ref')) + " = " + svar);
if (!(this.object)) {
sourcePart = ("(" + sourcePart + ")");