浏览代码

LibJS: Make sure `this` in the global environment is the global object

Fixes regressed with 0f9038b732a6e0f5830e5e95c0b2a1c78efea415.
Andreas Kling 4 年之前
父节点
当前提交
9683b10aec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibJS/Runtime/GlobalObject.cpp

+ 1 - 1
Userland/Libraries/LibJS/Runtime/GlobalObject.cpp

@@ -99,7 +99,7 @@ void GlobalObject::initialize_global_object()
     m_object_prototype = heap().allocate_without_global_object<ObjectPrototype>(*this);
     m_function_prototype = heap().allocate_without_global_object<FunctionPrototype>(*this);
 
-    m_environment_record = heap().allocate_without_global_object<GlobalEnvironmentRecord>(*this);
+    m_environment_record = heap().allocate<GlobalEnvironmentRecord>(*this, *this);
 
     m_new_object_shape = vm.heap().allocate_without_global_object<Shape>(*this);
     m_new_object_shape->set_prototype_without_transition(m_object_prototype);