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

LibJS: Fix tests that expected wrong this values

This commit is contained in:
davidot 2021-07-12 01:38:16 +02:00 committed by Andreas Kling
parent c6e9c6d6ab
commit a49b47bfe6
2 changed files with 10 additions and 0 deletions

View file

@ -25,6 +25,11 @@ describe("errors", () => {
describe("normal behavior", () => {
test("basic functionality", () => {
[1, 2].reduce(function () {
expect(this).toBe(globalThis);
});
[1, 2].reduce(function () {
"use strict";
expect(this).toBeUndefined();
});

View file

@ -25,6 +25,11 @@ describe("errors", () => {
describe("normal behavior", () => {
test("basic functionality", () => {
[1, 2].reduceRight(function () {
expect(this).toBe(globalThis);
});
[1, 2].reduceRight(function () {
"use strict";
expect(this).toBeUndefined();
});