]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/fold-load-varargs-arity-check-fail-barely.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / fold-load-varargs-arity-check-fail-barely.js
CommitLineData
ed1e77d3
A
1function foo(a, b) {
2 return [a, b];
3}
4
5function bar() {
6 return foo.apply(this, arguments);
7}
8
9function baz() {
10 return bar(42);
11}
12
13noInline(baz);
14
15for (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