From e992a9f469a536b5a5442229a1adddd27deb1db9 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 16 Aug 2022 00:20:50 +0100 Subject: LibJS+LibWeb: Replace GlobalObject with Realm in Heap::allocate() 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(). --- Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp') diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 4e9c2bc099..f0e1ad5ade 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -48,10 +48,10 @@ static ThrowCompletionOr perform_promise_common(GlobalObject& global_obje VERIFY(promise_resolve.is_function()); // 1. Let values be a new empty List. - auto* values = vm.heap().allocate_without_global_object(); + auto* values = vm.heap().allocate_without_realm(); // 2. Let remainingElementsCount be the Record { [[Value]]: 1 }. - auto* remaining_elements_count = vm.heap().allocate_without_global_object(1); + auto* remaining_elements_count = vm.heap().allocate_without_realm(1); // 3. Let index be 0. size_t index = 0; -- cgit v1.2.3