]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/infer-uninitialized-closure-var.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / infer-uninitialized-closure-var.js
CommitLineData
ed1e77d3
A
1function foo(p) {
2 var x;
3
4 noInline(f);
5
6 if (p) {
7 var f = function() { return x; }
8
9 foo(false);
10
11 for (var i = 0; i < 10000; ++i) {
12 var result = f();
13 if (result !== void 0)
14 throw "Error: bad result (1): " + result;
15 }
16
17 x = 43;
18
19 var result = f();
20 if (result != 43)
21 throw "Error: bad result (2): " + result;
22 } else
23 x = 42;
24}
25
26foo(true);