summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/pic/watch3.js
blob: 4c5c93d8bbc8e1388d3a7494b401d7cefb2e6705 (plain)
1
2
3
4
5
6
7
// assignment to watched global properties must not be cached
x = 0;
var hits = 0;
this.watch("x", function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
    x = i;
assertEq(hits, 10);