LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions

This is a continuation of the previous commit.

Calling initialize() is the first thing that's done after allocating a
cell on the JS heap - and in the common case of allocating an object,
that's where properties are assigned and intrinsics occasionally
accessed.
Since those are supposed to live on the realm eventually, this is
another step into that direction.
This commit is contained in:
Linus Groh 2022-08-16 00:20:49 +01:00
parent ecd163bdf1
commit 5dd5896588
Notes: sideshowbarker 2024-07-17 08:01:21 +09:00
304 changed files with 608 additions and 603 deletions

View file

@ -81,12 +81,12 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyTableConstructor::construct(Functi
return vm.heap().allocate<WebAssemblyTableObject>(global_object, realm, *address);
}
void WebAssemblyTableConstructor::initialize(JS::GlobalObject& global_object)
void WebAssemblyTableConstructor::initialize(JS::Realm& realm)
{
auto& vm = this->vm();
auto& window = static_cast<WindowObject&>(global_object);
auto& window = static_cast<WindowObject&>(realm.global_object());
NativeFunction::initialize(global_object);
NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<WebAssemblyTablePrototype>("WebAssemblyTablePrototype"), 0);
define_direct_property(vm.names.length, JS::Value(1), JS::Attribute::Configurable);
}