mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS+LibWeb: Replace GlobalObject with Realm in Heap::allocate<T>()
This is a continuation of the previous three commits. Now that create() receives the allocating realm, we can simply forward that to allocate(), which accounts for the majority of these changes. Additionally, we can get rid of the realm_from_global_object() in one place, with one more remaining in VM::throw_completion().
This commit is contained in:
@@ -53,7 +53,7 @@ ThrowCompletionOr<void> SyntheticModule::link(VM& vm)
|
||||
auto& global_object = realm().global_object();
|
||||
|
||||
// 3. Let env be NewModuleEnvironment(realm.[[GlobalEnv]]).
|
||||
auto* environment = vm.heap().allocate_without_global_object<ModuleEnvironment>(&realm().global_environment());
|
||||
auto* environment = vm.heap().allocate_without_realm<ModuleEnvironment>(&realm().global_environment());
|
||||
|
||||
// 4. Set module.[[Environment]] to env.
|
||||
set_environment(environment);
|
||||
|
||||
Reference in New Issue
Block a user