mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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
Notes:
sideshowbarker
2024-07-19 07:46:53 +09:00
Author: https://github.com/linusg
Commit: c06a6c67d5
Pull-request: https://github.com/SerenityOS/serenity/pull/1711
3 changed files with 2 additions and 3 deletions
|
@ -384,7 +384,6 @@ int main(int argc, char** argv)
|
|||
if (script_path == nullptr) {
|
||||
auto interpreter = JS::Interpreter::create<ReplObject>();
|
||||
interpreter->heap().set_should_collect_on_every_allocation(gc_on_every_allocation);
|
||||
interpreter->global_object().put("global", &interpreter->global_object());
|
||||
if (test_mode) {
|
||||
interpreter->global_object().put_native_function("assert", assert_impl);
|
||||
}
|
||||
|
@ -515,7 +514,6 @@ int main(int argc, char** argv)
|
|||
} else {
|
||||
auto interpreter = JS::Interpreter::create<JS::GlobalObject>();
|
||||
interpreter->heap().set_should_collect_on_every_allocation(gc_on_every_allocation);
|
||||
interpreter->global_object().put("global", &interpreter->global_object());
|
||||
if (test_mode) {
|
||||
interpreter->global_object().put_native_function("assert", assert_impl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue