1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/pic/watch3a.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +// assignment to watched global properties must not be traced 1.5 +var hits = 0; 1.6 +function counter(id, oldval, newval) { 1.7 + hits++; 1.8 + return newval; 1.9 +} 1.10 + 1.11 +var x = 0; 1.12 +var y = 0; 1.13 +(function () { 1.14 + var a = ['x', 'y']; 1.15 + this.watch('z', counter); 1.16 + for (var i = 0; i < 14; i++) { 1.17 + this.watch(a[+(i > 8)], counter); 1.18 + y = 1; 1.19 + } 1.20 +})(); 1.21 +assertEq(hits, 5); 1.22 +