mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47: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:
parent
f4129ac422
commit
4a49c8412c
2 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue