Fixing issue #276 -- unsoaked cached indexes.
This commit is contained in:
parent
dc0b03e54e
commit
2e3f575f9c
|
@ -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];
|
||||
|
|
|
@ -347,8 +347,9 @@ exports.ValueNode = class ValueNode extends BaseNode
|
|||
for prop, i in copy.properties
|
||||
if prop instanceof IndexNode and prop.index.isComplex()
|
||||
[index, indexVar] = prop.index.compileReference o
|
||||
this.properties[i] = new IndexNode index
|
||||
this.properties[i] = first = new IndexNode index
|
||||
copy.properties[i] = new IndexNode indexVar
|
||||
first.soakNode = yes if prop.soakNode
|
||||
[this, copy]
|
||||
|
||||
# Override compile to unwrap the value when possible.
|
||||
|
|
|
@ -147,3 +147,5 @@ ok (maybe_close plus1, 41)?() is 42
|
|||
ok (maybe_close 'string', 41)?() is undefined
|
||||
|
||||
ok 2?(3) is undefined
|
||||
|
||||
ok calendar?[Date()] is undefined
|
||||
|
|
Loading…
Reference in New Issue