1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

LibJS: Add tests ensuring the |this| value can't be set for arrow

functions in Function.prototype.{call,apply}
This commit is contained in:
Jack Karamanian 2020-05-30 01:11:44 -05:00 committed by Andreas Kling
parent f4129ac422
commit 4a49c8412c
2 changed files with 4 additions and 0 deletions

View file

@ -47,6 +47,8 @@ try {
var multiply = function (x, y) { return x * y; };
assert(multiply.apply(null, [3, 4]) === 12);
assert((() => this).apply("foo") === globalThis);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);

View file

@ -47,6 +47,8 @@ try {
var multiply = function (x, y) { return x * y; };
assert(multiply.call(null, 3, 4) === 12);
assert((() => this).call("foo") === globalThis);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);