]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/dead-get-closure-var.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / dead-get-closure-var.js
1 var global;
2
3 function foo(a) {
4 var x = a.f;
5 var f = function() { global = x; };
6 noInline(f);
7 f();
8 var tmp1 = a.g + 1;
9 var tmp2 = x;
10 return global;
11 }
12
13 noInline(foo);
14
15 for (var i = 0; i < 10000; ++i) {
16 var result = foo({f:i, g:i + 1});
17 if (result != i)
18 throw "Error: bad result: " + result;
19 }
20
21 var result = foo({f:42, g:4.2});
22 if (result != 42)
23 throw "Error: bad result at end: " + result;