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:
parent
c6e9c6d6ab
commit
a49b47bfe6
2 changed files with 10 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue