1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibJS: Replace GlobalObject with VM in Promise AOs [Part 8/19]

This commit is contained in:
Linus Groh 2022-08-21 16:09:38 +01:00
parent ccdfa2320c
commit d74f8039eb
19 changed files with 151 additions and 137 deletions

View file

@ -214,7 +214,7 @@ ThrowCompletionOr<Value> shadow_realm_import_value(GlobalObject& global_object,
// 1. Assert: evalContext is an execution context associated to a ShadowRealm instance's [[ExecutionContext]].
// 2. Let innerCapability be ! NewPromiseCapability(%Promise%).
auto inner_capability = MUST(new_promise_capability(global_object, global_object.promise_constructor()));
auto inner_capability = MUST(new_promise_capability(vm, global_object.promise_constructor()));
// 3. Let runningContext be the running execution context.
// 4. If runningContext is not already suspended, suspend runningContext.
@ -269,7 +269,7 @@ ThrowCompletionOr<Value> shadow_realm_import_value(GlobalObject& global_object,
auto* on_fulfilled = NativeFunction::create(realm, move(steps), 1, "", &caller_realm);
// 12. Let promiseCapability be ! NewPromiseCapability(%Promise%).
auto promise_capability = MUST(new_promise_capability(global_object, global_object.promise_constructor()));
auto promise_capability = MUST(new_promise_capability(vm, global_object.promise_constructor()));
// NOTE: Even though the spec tells us to use %ThrowTypeError%, it's not observable if we actually do.
// Throw a nicer TypeError forwarding the import error message instead (we know the argument is an Error object).