mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 23:10: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)
29 lines
623 B
JavaScript
29 lines
623 B
JavaScript
function foo(a, b) {
|
|
return [a, b];
|
|
}
|
|
|
|
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 != 2)
|
|
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 < 2; ++j) {
|
|
if (result[j] !== void 0)
|
|
throw "Error: element " + j + " is not undefined: " + result[j];
|
|
}
|
|
}
|
|
|