LibJS: Properly initialize the global object for $262.createRealm

This commit is contained in:
davidot 2022-08-29 23:04:55 +02:00 committed by Linus Groh
parent 48cb15283a
commit 123cdfa1f1
Notes: sideshowbarker 2024-07-17 07:38:30 +09:00

View file

@ -62,6 +62,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
auto* realm_global_object = vm.heap().allocate_without_realm<GlobalObject>(*realm);
VERIFY(realm_global_object);
realm->set_global_object(realm_global_object, nullptr);
set_default_global_bindings(*realm);
realm_global_object->initialize(*realm);
return Value(realm_global_object->$262());
}