diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/ion/getprop-idempotent-cache-2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/ion/getprop-idempotent-cache-2.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,21 @@ +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);