]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js
CommitLineData
ed1e77d3
A
1function foo(v) {
2 global = v;
3}
4
5function bar() {
6 return global;
7}
8
9noInline(foo);
10noInline(bar);
11
12var value = 42;
13for (var i = 0; i < 10; ++i)
14 foo(value);
15var n = 100000;
16var m = 100;
17for (var i = 0; i < n; ++i) {
18 if (i == n - m)
19 foo(value = 53);
20 var result = bar();
21 if (result != value)
22 throw "Error: on iteration " + i + " got: " + result;
23}