mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS: Replace GlobalObject with VM in remaining AOs [Part 19/19]
This commit is contained in:
parent
25849f8a6d
commit
56b2ae5ac0
Notes:
sideshowbarker
2024-07-17 07:53:23 +09:00
Author: https://github.com/linusg
Commit: 56b2ae5ac0
Pull-request: https://github.com/SerenityOS/serenity/pull/14973
Reviewed-by: https://github.com/davidot ✅
46 changed files with 173 additions and 207 deletions
|
@ -29,16 +29,15 @@ Completion::Completion(ThrowCompletionOr<Value> const& throw_completion_or_value
|
|||
}
|
||||
|
||||
// 6.2.3.1 Await, https://tc39.es/ecma262/#await
|
||||
ThrowCompletionOr<Value> await(GlobalObject& global_object, Value value)
|
||||
ThrowCompletionOr<Value> await(VM& vm, Value value)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
auto& realm = *global_object.associated_realm();
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
// 1. Let asyncContext be the running execution context.
|
||||
// NOTE: This is not needed, as we don't suspend anything.
|
||||
|
||||
// 2. Let promise be ? PromiseResolve(%Promise%, value).
|
||||
auto* promise_object = TRY(promise_resolve(vm, *global_object.promise_constructor(), value));
|
||||
auto* promise_object = TRY(promise_resolve(vm, *realm.global_object().promise_constructor(), value));
|
||||
|
||||
Optional<bool> success;
|
||||
Value result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue