mirror of
https://github.com/tc39/test262.git
synced 2025-05-05 07:20:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
30 lines
636 B
JavaScript
30 lines
636 B
JavaScript
function foo(a, b, c, d) {
|
|
return [a, b, c, d];
|
|
}
|
|
|
|
function bar() {
|
|
return foo.apply(this, arguments);
|
|
}
|
|
|
|
function baz() {
|
|
return bar(42);
|
|
}
|
|
|
|
noInline(baz);
|
|
|
|
for (var i = 0; i < 10000; ++i) {
|
|
var result = baz();
|
|
if (!(result instanceof Array))
|
|
throw "Error: result is not an array.";
|
|
if (result.length != 4)
|
|
throw "Error: result doesn't have length 4.";
|
|
if (result[0] != 42)
|
|
throw "Error: first element is not 42: " + result[0];
|
|
for (var j = 1; j < 4; ++j) {
|
|
if (result[j] !== void 0)
|
|
throw "Error: element " + j + " is not undefined: " + result[j];
|
|
}
|
|
}
|
|
|
|
|