From 9683b10aec4fd01357c6255c4763ba07477e44ab Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 26 Jun 2021 17:05:29 +0200 Subject: [PATCH] LibJS: Make sure `this` in the global environment is the global object Fixes regressed with 0f9038b732a6e0f5830e5e95c0b2a1c78efea415. --- Userland/Libraries/LibJS/Runtime/GlobalObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 52173406032..e06db34dca5 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -99,7 +99,7 @@ void GlobalObject::initialize_global_object() m_object_prototype = heap().allocate_without_global_object(*this); m_function_prototype = heap().allocate_without_global_object(*this); - m_environment_record = heap().allocate_without_global_object(*this); + m_environment_record = heap().allocate(*this, *this); m_new_object_shape = vm.heap().allocate_without_global_object(*this); m_new_object_shape->set_prototype_without_transition(m_object_prototype);