]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function foo(a, b) { |
2 | return [a, b]; | |
3 | } | |
4 | ||
5 | function bar() { | |
6 | return foo.apply(this, arguments); | |
7 | } | |
8 | ||
9 | function baz() { | |
10 | return bar(42); | |
11 | } | |
12 | ||
13 | noInline(baz); | |
14 | ||
15 | for (var i = 0; i < 10000; ++i) { | |
16 | var result = baz(); | |
17 | if (!(result instanceof Array)) | |
18 | throw "Error: result is not an array."; | |
19 | if (result.length != 2) | |
20 | throw "Error: result doesn't have length 4."; | |
21 | if (result[0] != 42) | |
22 | throw "Error: first element is not 42: " + result[0]; | |
23 | for (var j = 1; j < 2; ++j) { | |
24 | if (result[j] !== void 0) | |
25 | throw "Error: element " + j + " is not undefined: " + result[j]; | |
26 | } | |
27 | } | |
28 |