Fixing issue #276 -- unsoaked cached indexes.

This commit is contained in:
Jeremy Ashkenas
2010-09-27 23:23:08 -04:00
parent dc0b03e54e
commit 2e3f575f9c
3 changed files with 10 additions and 4 deletions

View File

@@ -353,7 +353,7 @@
return this.base instanceof LiteralNode && this.base.value.match(NUMBER);
};
ValueNode.prototype.cacheIndexes = function(o) {
var _len, _ref2, _ref3, copy, i, index, indexVar, prop;
var _len, _ref2, _ref3, copy, first, i, index, indexVar, prop;
copy = new ValueNode(this.base, this.properties.slice(0));
if (this.base.isComplex()) {
_ref2 = this.base.compileReference(o);
@@ -367,8 +367,11 @@
_ref3 = prop.index.compileReference(o);
index = _ref3[0];
indexVar = _ref3[1];
this.properties[i] = new IndexNode(index);
this.properties[i] = (first = new IndexNode(index));
copy.properties[i] = new IndexNode(indexVar);
if (prop.soakNode) {
first.soakNode = true;
}
}
}
return [this, copy];