mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
quit caching v in for all k of v
This commit is contained in:
17
lib/nodes.js
17
lib/nodes.js
@@ -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 + ")");
|
||||
|
||||
Reference in New Issue
Block a user