mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-15 15:42:52 +00:00
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:
parent
ecd163bdf1
commit
5dd5896588
Notes:
sideshowbarker
2024-07-17 08:01:21 +09:00
Author: https://github.com/linusg
Commit: 5dd5896588
Pull-request: https://github.com/SerenityOS/serenity/pull/14973
Reviewed-by: https://github.com/davidot ✅
304 changed files with 608 additions and 603 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue