mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
Notes:
sideshowbarker
2024-07-17 08:01:21 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/5dd5896588 Pull-request: https://github.com/SerenityOS/serenity/pull/14973 Reviewed-by: https://github.com/davidot ✅
@@ -22,14 +22,14 @@ DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm)
|
||||
{
|
||||
}
|
||||
|
||||
void DateTimeFormatConstructor::initialize(GlobalObject& global_object)
|
||||
void DateTimeFormatConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 11.2.1 Intl.DateTimeFormat.prototype, https://tc39.es/ecma402/#sec-intl.datetimeformat.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_date_time_format_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_date_time_format_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
|
||||
|
||||
Reference in New Issue
Block a user