mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
LibJS: Fix tests that expected wrong this values
This commit is contained in:
parent
c6e9c6d6ab
commit
a49b47bfe6
Notes:
sideshowbarker
2024-07-18 08:39:31 +09:00
Author: https://github.com/davidot
Commit: a49b47bfe6
Pull-request: https://github.com/SerenityOS/serenity/pull/8667
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg
2 changed files with 10 additions and 0 deletions
|
@ -25,6 +25,11 @@ describe("errors", () => {
|
||||||
describe("normal behavior", () => {
|
describe("normal behavior", () => {
|
||||||
test("basic functionality", () => {
|
test("basic functionality", () => {
|
||||||
[1, 2].reduce(function () {
|
[1, 2].reduce(function () {
|
||||||
|
expect(this).toBe(globalThis);
|
||||||
|
});
|
||||||
|
|
||||||
|
[1, 2].reduce(function () {
|
||||||
|
"use strict";
|
||||||
expect(this).toBeUndefined();
|
expect(this).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,11 @@ describe("errors", () => {
|
||||||
describe("normal behavior", () => {
|
describe("normal behavior", () => {
|
||||||
test("basic functionality", () => {
|
test("basic functionality", () => {
|
||||||
[1, 2].reduceRight(function () {
|
[1, 2].reduceRight(function () {
|
||||||
|
expect(this).toBe(globalThis);
|
||||||
|
});
|
||||||
|
|
||||||
|
[1, 2].reduceRight(function () {
|
||||||
|
"use strict";
|
||||||
expect(this).toBeUndefined();
|
expect(this).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue