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