diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-16 00:20:50 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | e992a9f469a536b5a5442229a1adddd27deb1db9 (patch) | |
tree | 0fcfb0c3205530e9fd91d2cf8da315fb467e6d70 /Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | |
parent | b99cc7d05039b9386538a581244be5af782c8d05 (diff) | |
download | serenity-e992a9f469a536b5a5442229a1adddd27deb1db9.zip |
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().
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<Value> 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<PromiseValueList>(); + auto* values = vm.heap().allocate_without_realm<PromiseValueList>(); // 2. Let remainingElementsCount be the Record { [[Value]]: 1 }. - auto* remaining_elements_count = vm.heap().allocate_without_global_object<RemainingElements>(1); + auto* remaining_elements_count = vm.heap().allocate_without_realm<RemainingElements>(1); // 3. Let index be 0. size_t index = 0; |