]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(x) { |
2 | return new Array(x); | |
3 | } | |
4 | ||
5 | noInline(foo); | |
6 | ||
7 | function test(size) { | |
8 | var result = foo(size); | |
9 | if (result.length != size) | |
10 | throw "Error: bad result: " + result; | |
11 | var sawThings = false; | |
12 | for (var s in result) | |
13 | sawThings = true; | |
14 | if (sawThings) | |
15 | throw "Error: array is in bad state: " + result; | |
16 | } | |
17 | ||
18 | for (var i = 0; i < 100000; ++i) { | |
19 | test(0); | |
20 | test(1); | |
21 | test(42); | |
22 | } |