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

LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]

This commit is contained in:
Linus Groh 2022-08-21 19:24:32 +01:00
parent 7856886ed5
commit 25849f8a6d
95 changed files with 536 additions and 677 deletions

View file

@ -94,10 +94,10 @@ ThrowCompletionOr<Value> ordinary_wrapped_function_call(WrappedFunction const& f
auto* caller_realm = function.realm();
// 4. NOTE: Any exception objects produced after this point are associated with callerRealm.
auto& global_object = caller_realm->global_object();
VERIFY(vm.current_realm() == caller_realm);
// 5. Let targetRealm be ? GetFunctionRealm(target).
auto* target_realm = TRY(get_function_realm(global_object, target));
auto* target_realm = TRY(get_function_realm(vm, target));
// 6. Let wrappedArgs be a new empty List.
auto wrapped_args = MarkedVector<Value> { vm.heap() };
@ -116,7 +116,7 @@ ThrowCompletionOr<Value> ordinary_wrapped_function_call(WrappedFunction const& f
auto wrapped_this_argument = TRY(get_wrapped_value(vm, *target_realm, this_argument));
// 9. Let result be the Completion Record of Call(target, wrappedThisArgument, wrappedArgs).
auto result = call(global_object, &target, wrapped_this_argument, move(wrapped_args));
auto result = call(vm, &target, wrapped_this_argument, move(wrapped_args));
// 10. If result.[[Type]] is normal or result.[[Type]] is return, then
if (!result.is_throw_completion()) {