mirror of
https://github.com/RGBCube/serenity
synced 2025-07-03 05:42:06 +00:00
LibJS: Add globalThis
We already have "global" as a way to access the global object in js(1) (both REPL and script mode). This replaces it with "globalThis", which is available in all environments, not just js.
This commit is contained in:
parent
cbecb23e1d
commit
c06a6c67d5
3 changed files with 2 additions and 3 deletions
|
@ -61,6 +61,7 @@ GlobalObject::GlobalObject()
|
|||
put("Infinity", js_infinity());
|
||||
put("undefined", js_undefined());
|
||||
|
||||
put("globalThis", this);
|
||||
put("console", heap().allocate<ConsoleObject>());
|
||||
put("Math", heap().allocate<MathObject>());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue