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