1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

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.
This commit is contained in:
Linus Groh 2020-11-06 18:56:54 +00:00 committed by Andreas Kling
parent 965050796f
commit 06a3625545
2 changed files with 4 additions and 0 deletions

View file

@ -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]");
});