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/Promise.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/Promise.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Promise.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Promise.cpp b/Userland/Libraries/LibJS/Runtime/Promise.cpp index 7367b37bd3..9da044340e 100644 --- a/Userland/Libraries/LibJS/Runtime/Promise.cpp +++ b/Userland/Libraries/LibJS/Runtime/Promise.cpp @@ -45,7 +45,7 @@ ThrowCompletionOr<Object*> promise_resolve(GlobalObject& global_object, Object& Promise* Promise::create(Realm& realm) { - return realm.heap().allocate<Promise>(realm.global_object(), *realm.global_object().promise_prototype()); + return realm.heap().allocate<Promise>(realm, *realm.global_object().promise_prototype()); } // 27.2 Promise Objects, https://tc39.es/ecma262/#sec-promise-objects @@ -64,7 +64,7 @@ Promise::ResolvingFunctions Promise::create_resolving_functions() auto& realm = *global_object.associated_realm(); // 1. Let alreadyResolved be the Record { [[Value]]: false }. - auto* already_resolved = vm.heap().allocate_without_global_object<AlreadyResolved>(); + auto* already_resolved = vm.heap().allocate_without_realm<AlreadyResolved>(); // 2. Let stepsResolve be the algorithm steps defined in Promise Resolve Functions. // 3. Let lengthResolve be the number of non-optional parameters of the function definition in Promise Resolve Functions. |