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

LibJS+LibWeb: Restore type safety of Realm::set_global_object()

The changes from 8a03b17 to allow any JS::Value aren't a good fit, as
shown by the excessive amount of verify_cast needed :^)
This commit is contained in:
Linus Groh 2022-08-06 01:01:13 +01:00 committed by Andreas Kling
parent 64b29eb459
commit c8f1651761
10 changed files with 27 additions and 36 deletions

View file

@ -61,7 +61,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
VERIFY(realm);
auto* realm_global_object = vm.heap().allocate_without_global_object<GlobalObject>(*realm);
VERIFY(realm_global_object);
realm->set_global_object(realm_global_object, js_undefined());
realm->set_global_object(realm_global_object, nullptr);
realm_global_object->set_associated_realm(*realm);
realm_global_object->initialize_global_object();
return Value(realm_global_object->$262());