diff options
author | Linus Groh <mail@linusgroh.de> | 2020-11-06 18:56:54 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-07 10:08:05 +0100 |
commit | 06a362554520ef96ef97f79cca32b1bc0d421f9c (patch) | |
tree | 8e652a4537ac85e01228f680717da3c8c8311ee7 /Libraries/LibJS/Tests/builtins | |
parent | 965050796f901fb28696e83574568db20e3b7b2b (diff) | |
download | serenity-06a362554520ef96ef97f79cca32b1bc0d421f9c.zip |
LibJS: Set prototype of GlobalObject to ObjectPrototype
As the global object is constructed and initialized in a different way
than most other objects we were not setting its prototype! This made
things like "globalThis.toString()" fail unexpectedly.
Diffstat (limited to 'Libraries/LibJS/Tests/builtins')
-rw-r--r-- | Libraries/LibJS/Tests/builtins/Object/Object.prototype.toString.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/builtins/Object/Object.prototype.toString.js b/Libraries/LibJS/Tests/builtins/Object/Object.prototype.toString.js index c5d6d77b0e..5bdd157de4 100644 --- a/Libraries/LibJS/Tests/builtins/Object/Object.prototype.toString.js +++ b/Libraries/LibJS/Tests/builtins/Object/Object.prototype.toString.js @@ -15,4 +15,6 @@ test("result for various object types", () => { expect(oToString(new Date())).toBe("[object Date]"); expect(oToString(new RegExp())).toBe("[object RegExp]"); expect(oToString({})).toBe("[object Object]"); + + expect(globalThis.toString()).toBe("[object Object]"); }); |