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)
66 lines
1.1 KiB
JavaScript
66 lines
1.1 KiB
JavaScript
function shouldBe(actual, expected)
|
|
{
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
|
|
(function () {
|
|
function test2(...rest)
|
|
{
|
|
return rest;
|
|
}
|
|
|
|
function test1(arg1, arg2, arg3)
|
|
{
|
|
return test2(arg1, arg2, arg3);
|
|
}
|
|
|
|
function test()
|
|
{
|
|
var result = test1();
|
|
shouldBe(result.length, 3);
|
|
shouldBe(result[0], undefined);
|
|
shouldBe(result[1], undefined);
|
|
shouldBe(result[2], undefined);
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e4; ++i)
|
|
test();
|
|
}());
|
|
|
|
(function () {
|
|
function test1(...rest)
|
|
{
|
|
return rest;
|
|
}
|
|
|
|
function test()
|
|
{
|
|
var result = test1();
|
|
shouldBe(result.length, 0);
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e4; ++i)
|
|
test();
|
|
}());
|
|
|
|
(function () {
|
|
function test1(...rest)
|
|
{
|
|
return rest;
|
|
}
|
|
noInline(test1);
|
|
|
|
function test()
|
|
{
|
|
var result = test1();
|
|
shouldBe(result.length, 0);
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e4; ++i)
|
|
test();
|
|
}());
|