]>
Commit | Line | Data |
---|---|---|
1 | "use strict"; | |
2 | ||
3 | function foo(a, b) { | |
4 | return a + b; | |
5 | } | |
6 | ||
7 | function bar() { | |
8 | var a = arguments; | |
9 | var tmp = arguments[0] + 1; | |
10 | return tmp + foo.apply(null, a); | |
11 | } | |
12 | ||
13 | function baz() { | |
14 | return bar.apply(this, arguments); | |
15 | } | |
16 | ||
17 | noInline(baz); | |
18 | ||
19 | for (var i = 0; i < 10000; ++i) { | |
20 | var result = baz(1, 2); | |
21 | if (result != 1 + 1 + 3) | |
22 | throw "Error: bad result: " + result; | |
23 | } | |
24 | ||
25 | var result = baz(1.5, 2); | |
26 | if (result != 1.5 + 1 + 3.5) | |
27 | throw "Error: bad result at end: " + result; |