]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/new-undecided-array-with-size.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / new-undecided-array-with-size.js
CommitLineData
81345200
A
1function foo(x) {
2 return new Array(x);
3}
4
5noInline(foo);
6
7function 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
18for (var i = 0; i < 100000; ++i) {
19 test(0);
20 test(1);
21 test(42);
22}