]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo() { |
2 | var a = arguments; | |
3 | return new Array(a[0]); | |
4 | } | |
5 | ||
6 | function bar(x) { | |
7 | return foo(x); | |
8 | } | |
9 | ||
10 | noInline(bar); | |
11 | ||
12 | for (var i = 0; i < 10000; ++i) { | |
13 | var result = bar(42); | |
14 | if (result.length != 42) | |
15 | throw "Error: bad result length: " + result; | |
16 | } | |
17 | ||
18 | var didThrow = false; | |
19 | try { | |
20 | bar(-1); | |
21 | } catch (e) { | |
22 | didThrow = e; | |
23 | } | |
24 | ||
25 | if (("" + didThrow).indexOf("RangeError") != 0) | |
26 | throw "Error: did not throw right exception: " + didThrow; |