]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - tests/stress/goofy-function-reentry-incorrect-inference.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / goofy-function-reentry-incorrect-inference.js
... / ...
CommitLineData
1function foo(a) {
2 var x;
3 if (a)
4 x = a;
5 return [function() {
6 return x;
7 }, function(a) {
8 x = a;
9 }];
10}
11
12var array = foo(false);
13noInline(array[0]);
14noInline(array[1]);
15array[1](42);
16for (var i = 0; i < 10000; ++i) {
17 var result = array[0]();
18 if (result != 42)
19 throw "Error: bad result in loop: " + result;
20}
21
22array[1](43);
23var result = array[0]();
24if (result != 43)
25 throw "Error: bad result at end: " + result;