]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/infinite-loop-that-uses-captured-variables-with-osr-entry.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / infinite-loop-that-uses-captured-variables-with-osr-entry.js
CommitLineData
81345200
A
1var count = 0;
2
3function bar(f) {
4 if (++count >= 10000)
5 throw f;
6}
7
8noInline(bar);
9
10function foo(a) {
11 var x = a + 1;
12 for (;;) {
13 bar(function() { return x; });
14 }
15}
16
17noInline(foo);
18
19try {
20 foo(42);
21} catch (f) {
22 var result = f();
23 if (result != 43)
24 throw "Error: bad result: " + result;
25}
26