]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/singleton-scope-then-overwrite.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / singleton-scope-then-overwrite.js
1 function foo(a) {
2 var x = a + 1;
3 var f = function(a) {
4 return x + a;
5 };
6 noInline(f);
7 for (var i = 0; i < 10000; ++i) {
8 var result = f(i);
9 if (result != a + 1 + i)
10 throw "Error: bad result: " + result;
11 }
12 x = 999;
13 var result = f(1);
14 if (result != 999 + 1)
15 throw "Error: bad result: " + result;
16 }
17
18 noInline(foo);
19 for (var i = 0; i < 3; ++i)
20 foo(42 + i);