blob: 8da24537d9ad02a88bbd26468ce8168012db2ff6 [file] [log] [blame]
function f(o) {
var res = 0;
for (var i=0; i<110; i++) {
res += o.x;
}
return res;
}
function O(x) {
if ([].length == 0) // Thwart definite slot analysis.
this.x = 10;
}
var o = new O(true);
f(o);
// Add a getter, this should invalidate the script containing the idempotent cache.
var res = 0;
o.__defineGetter__("x", function() { res++; });
f(o);
assertEq(res, 110);