diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/pic/watch3b.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/pic/watch3b.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,20 @@ +// assignment to watched global properties must not be traced +var hits = 0; +function counter(id, oldval, newval) { + hits++; + return newval; +} + +var x = 0; +var y = 0; +function f() { + var a = [{}, this]; + for (var i = 0; i < 14; i++) { + print(shapeOf(this)); + Object.prototype.watch.call(a[+(i > 8)], "y", counter); + y++; + } +} +f(); +assertEq(hits, 5); +