mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:17:44 +00:00
LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]
This commit is contained in:
parent
7856886ed5
commit
25849f8a6d
95 changed files with 536 additions and 677 deletions
|
@ -15,7 +15,6 @@ namespace JS {
|
|||
ThrowCompletionOr<PromiseCapability> new_promise_capability(VM& vm, Value constructor)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
auto& global_object = realm.global_object();
|
||||
|
||||
// 1. If IsConstructor(C) is false, throw a TypeError exception.
|
||||
if (!constructor.is_constructor())
|
||||
|
@ -59,7 +58,7 @@ ThrowCompletionOr<PromiseCapability> new_promise_capability(VM& vm, Value constr
|
|||
auto* executor = NativeFunction::create(realm, move(executor_closure), 2, "");
|
||||
|
||||
// 6. Let promise be ? Construct(C, « executor »).
|
||||
auto* promise = TRY(construct(global_object, constructor.as_function(), executor));
|
||||
auto* promise = TRY(construct(vm, constructor.as_function(), executor));
|
||||
|
||||
// 7. If IsCallable(promiseCapability.[[Resolve]]) is false, throw a TypeError exception.
|
||||
if (!promise_capability_functions.resolve.is_function())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue