From 23c5323a7096e85a7ca73b746e6f38ec0e51b4e5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 27 Mar 2020 12:24:58 +0100 Subject: [PATCH] js: Publish the global object as "global" --- Userland/js.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/js.cpp b/Userland/js.cpp index 262cdfc249..0029e80134 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -204,6 +204,8 @@ int main(int argc, char** argv) JS::Interpreter interpreter; interpreter.heap().set_should_collect_on_every_allocation(gc_on_every_allocation); + interpreter.global_object().put("global", &interpreter.global_object()); + if (script_path == nullptr) { repl(interpreter); } else {