1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:05:06 +00:00

LibJS/Tests: Rename function parameter from 'arguments' to 'arguments_'

The former has a special meaning and should be avoided where possible.
This commit is contained in:
Linus Groh 2021-05-10 11:54:01 +01:00
parent 0126c81a7f
commit d1a72dc6eb
2 changed files with 15 additions and 9 deletions

View file

@ -27,11 +27,13 @@ describe("[[Construct]] trap normal behavior", () => {
let p;
const handler = {
construct(target, arguments, newTarget) {
construct(target, arguments_, newTarget) {
expect(target).toBe(f);
expect(newTarget).toBe(p);
if (arguments[1]) return Reflect.construct(target, [arguments[0] * 2], newTarget);
return Reflect.construct(target, arguments, newTarget);
if (arguments_[1]) {
return Reflect.construct(target, [arguments_[0] * 2], newTarget);
}
return Reflect.construct(target, arguments_, newTarget);
},
};
p = new Proxy(f, handler);
@ -48,11 +50,13 @@ describe("[[Construct]] trap normal behavior", () => {
let p;
function theNewTarget() {}
const handler = {
construct(target, arguments, newTarget) {
construct(target, arguments_, newTarget) {
expect(target).toBe(f);
expect(newTarget).toBe(theNewTarget);
if (arguments[1]) return Reflect.construct(target, [arguments[0] * 2], newTarget);
return Reflect.construct(target, arguments, newTarget);
if (arguments_[1]) {
return Reflect.construct(target, [arguments_[0] * 2], newTarget);
}
return Reflect.construct(target, arguments_, newTarget);
},
};
p = new Proxy(f, handler);