]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function thingy(f) { |
2 | f(); | |
3 | } | |
4 | noInline(thingy); | |
5 | ||
6 | function foo(a) { | |
7 | var x; | |
8 | if (a) | |
9 | x = a; | |
10 | thingy(function() { return x; }); | |
11 | var result = 0; | |
12 | for (var i = 0; i < 100000; ++i) | |
13 | result += x; | |
14 | return result; | |
15 | } | |
16 | ||
17 | noInline(foo); | |
18 | ||
19 | for (var i = 0; i < 10; ++i) { | |
20 | var result = foo(42); | |
21 | if (result != 4200000) | |
22 | throw "Error: bad first result: " + result; | |
23 | } | |
24 | ||
25 | var result = foo(0); | |
26 | if ("" + result != "NaN") | |
27 | throw "Error: bad result at end: " + result; | |
28 |