diff options
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduce.js | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduceRight.js | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduce.js b/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduce.js index 110dcf8e1a..68dd0bf2e1 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduce.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduce.js @@ -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(); }); diff --git a/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduceRight.js b/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduceRight.js index 0a3f4acad9..d939ed3ada 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduceRight.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.reduceRight.js @@ -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(); }); |