1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 16:37:47 +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

@ -57,8 +57,7 @@ JS::Completion call_user_object_operation(Bindings::CallbackType& callback, Stri
auto& object = *callback.callback.cell();
// 4. Let realm be Os associated Realm.
auto& global_object = object.global_object();
auto& realm = *global_object.associated_realm();
auto& realm = object.shape().realm();
// 5. Let relevant settings be realms settings object.
auto& relevant_settings = verify_cast<HTML::EnvironmentSettingsObject>(*realm.host_defined());
@ -105,7 +104,8 @@ JS::Completion call_user_object_operation(Bindings::CallbackType& callback, Stri
// 12. Let callResult be Call(X, thisArg, esArgs).
VERIFY(actual_function_object);
auto call_result = JS::call(global_object, verify_cast<JS::FunctionObject>(*actual_function_object), this_argument.value(), forward<Args>(args)...);
auto& vm = object.vm();
auto call_result = JS::call(vm, verify_cast<JS::FunctionObject>(*actual_function_object), this_argument.value(), forward<Args>(args)...);
// 13. If callResult is an abrupt completion, set completion to callResult and jump to the step labeled return.
if (call_result.is_throw_completion()) {