From 0cbef8794478c32b0346c32eb36ca874b0be7c00 Mon Sep 17 00:00:00 2001 From: Marcin Gasperowicz Date: Thu, 4 Jun 2020 18:56:45 +0200 Subject: [PATCH] LibJS: Fix rest-params test to take function hoisting into account --- Libraries/LibJS/Tests/function-rest-params.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/LibJS/Tests/function-rest-params.js b/Libraries/LibJS/Tests/function-rest-params.js index c1bc9fd422..efcd66cddf 100644 --- a/Libraries/LibJS/Tests/function-rest-params.js +++ b/Libraries/LibJS/Tests/function-rest-params.js @@ -7,7 +7,7 @@ try { } foo(); - function foo(...a) { + function foo1(...a) { assert(a instanceof Array); assert(a.length === 4); assert(a[0] === "foo"); @@ -15,17 +15,17 @@ try { assert(a[2] === undefined); assert(a[3].foo === "bar"); } - foo("foo", 123, undefined, { foo: "bar" }); + foo1("foo", 123, undefined, { foo: "bar" }); - function foo(a, b, ...c) { + function foo2(a, b, ...c) { assert(a === "foo"); assert(b === 123); assert(c instanceof Array); assert(c.length === 0); } - foo("foo", 123); + foo2("foo", 123); - function foo(a, b, ...c) { + function foo3(a, b, ...c) { assert(a === "foo"); assert(b === 123); assert(c instanceof Array); @@ -33,7 +33,7 @@ try { assert(c[0] === undefined); assert(c[1].foo === "bar"); } - foo("foo", 123, undefined, { foo: "bar" }); + foo3("foo", 123, undefined, { foo: "bar" }); var foo = (...a) => { assert(a instanceof Array);