mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +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:
parent
b99cc7d050
commit
e992a9f469
Notes:
sideshowbarker
2024-07-17 09:49:48 +09:00
Author: https://github.com/linusg
Commit: e992a9f469
Pull-request: https://github.com/SerenityOS/serenity/pull/14973
Reviewed-by: https://github.com/davidot ✅
82 changed files with 148 additions and 148 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue