summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Promise.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-21 19:24:32 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commit25849f8a6daf6c73e11851e94aa3edeb00190d01 (patch)
treecb7e78ca5e0153a9695792ee54e976462e93bdc6 /Userland/Libraries/LibJS/Runtime/Promise.cpp
parent7856886ed5953e35a210c2b95cb9fdc8d3bb0c60 (diff)
downloadserenity-25849f8a6daf6c73e11851e94aa3edeb00190d01.zip
LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Promise.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Promise.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Promise.cpp b/Userland/Libraries/LibJS/Runtime/Promise.cpp
index 6e217a36d4..96b51c7ab1 100644
--- a/Userland/Libraries/LibJS/Runtime/Promise.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Promise.cpp
@@ -21,9 +21,6 @@ namespace JS {
// 27.2.4.7.1 PromiseResolve ( C, x ), https://tc39.es/ecma262/#sec-promise-resolve
ThrowCompletionOr<Object*> promise_resolve(VM& vm, Object& constructor, Value value)
{
- auto& realm = *vm.current_realm();
- auto& global_object = realm.global_object();
-
// 1. If IsPromise(x) is true, then
if (value.is_object() && is<Promise>(value.as_object())) {
// a. Let xConstructor be ? Get(x, "constructor").
@@ -38,7 +35,7 @@ ThrowCompletionOr<Object*> promise_resolve(VM& vm, Object& constructor, Value va
auto promise_capability = TRY(new_promise_capability(vm, &constructor));
// 3. Perform ? Call(promiseCapability.[[Resolve]], undefined, ยซ x ยป).
- (void)TRY(call(global_object, *promise_capability.resolve, js_undefined(), value));
+ (void)TRY(call(vm, *promise_capability.resolve, js_undefined(), value));
// 4. Return promiseCapability.[[Promise]].
return promise_capability.promise;