瀏覽代碼

js: Publish the global object as "global"

Andreas Kling 5 年之前
父節點
當前提交
23c5323a70
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/js.cpp

+ 2 - 0
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 {