mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Add [[GlobalThisValue]] internal slot to GlobalEnvironment
Instead of hardcoding the environment's global object as the return value of GlobalEnvironment::global_this_value(), it now stores an Object reference which is passed to the constructor for this purpose. From the spec (https://tc39.es/ecma262/#sec-global-environment-records): [[GlobalThisValue]] | Object | The value returned by this in global scope. Hosts may provide any ECMAScript Object value.
This commit is contained in:
@@ -129,7 +129,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 = heap().allocate<GlobalEnvironment>(*this, *this);
|
||||
m_environment = heap().allocate<GlobalEnvironment>(*this, *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);
|
||||
|
||||
Reference in New Issue
Block a user