mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +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
304 changed files with 608 additions and 603 deletions
|
@ -23,9 +23,9 @@ CollatorCompareFunction::CollatorCompareFunction(Realm& realm, Collator& collato
|
|||
{
|
||||
}
|
||||
|
||||
void CollatorCompareFunction::initialize(GlobalObject& global_object)
|
||||
void CollatorCompareFunction::initialize(Realm&)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
auto& vm = this->vm();
|
||||
define_direct_property(vm.names.length, Value(2), Attribute::Configurable);
|
||||
define_direct_property(vm.names.name, js_string(vm, String::empty()), Attribute::Configurable);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
static CollatorCompareFunction* create(GlobalObject&, Collator&);
|
||||
|
||||
CollatorCompareFunction(Realm&, Collator&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorCompareFunction() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -137,14 +137,14 @@ CollatorConstructor::CollatorConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void CollatorConstructor::initialize(GlobalObject& global_object)
|
||||
void CollatorConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 10.2.1 Intl.Collator.prototype, https://tc39.es/ecma402/#sec-intl.collator.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_collator_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_collator_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
|
|
@ -15,7 +15,7 @@ class CollatorConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit CollatorConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -17,9 +17,9 @@ CollatorPrototype::CollatorPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void CollatorPrototype::initialize(GlobalObject& global_object)
|
||||
void CollatorPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class CollatorPrototype final : public PrototypeObject<CollatorPrototype, Collat
|
|||
|
||||
public:
|
||||
explicit CollatorPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -15,7 +15,7 @@ class DateTimeFormatConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit DateTimeFormatConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DateTimeFormatConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -25,11 +25,11 @@ DateTimeFormatFunction::DateTimeFormatFunction(DateTimeFormat& date_time_format,
|
|||
{
|
||||
}
|
||||
|
||||
void DateTimeFormatFunction::initialize(GlobalObject& global_object)
|
||||
void DateTimeFormatFunction::initialize(Realm& realm)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
Base::initialize(global_object);
|
||||
Base::initialize(realm);
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
define_direct_property(vm.names.name, js_string(vm, String::empty()), Attribute::Configurable);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
explicit DateTimeFormatFunction(DateTimeFormat&, Object& prototype);
|
||||
virtual ~DateTimeFormatFunction() override = default;
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ DateTimeFormatPrototype::DateTimeFormatPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void DateTimeFormatPrototype::initialize(GlobalObject& global_object)
|
||||
void DateTimeFormatPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class DateTimeFormatPrototype final : public PrototypeObject<DateTimeFormatProto
|
|||
|
||||
public:
|
||||
explicit DateTimeFormatPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DateTimeFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -21,14 +21,14 @@ DisplayNamesConstructor::DisplayNamesConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void DisplayNamesConstructor::initialize(GlobalObject& global_object)
|
||||
void DisplayNamesConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 12.2.1 Intl.DisplayNames.prototype, https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_display_names_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_display_names_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
|
||||
|
|
|
@ -15,7 +15,7 @@ class DisplayNamesConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit DisplayNamesConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DisplayNamesConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -19,9 +19,9 @@ DisplayNamesPrototype::DisplayNamesPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void DisplayNamesPrototype::initialize(GlobalObject& global_object)
|
||||
void DisplayNamesPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class DisplayNamesPrototype final : public PrototypeObject<DisplayNamesPrototype
|
|||
|
||||
public:
|
||||
explicit DisplayNamesPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DisplayNamesPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,14 +19,14 @@ DurationFormatConstructor::DurationFormatConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void DurationFormatConstructor::initialize(GlobalObject& global_object)
|
||||
void DurationFormatConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1.3.1 Intl.DurationFormat.prototype, https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_duration_format_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_duration_format_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
|
|
@ -15,7 +15,7 @@ class DurationFormatConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit DurationFormatConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DurationFormatConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -16,9 +16,9 @@ DurationFormatPrototype::DurationFormatPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void DurationFormatPrototype::initialize(GlobalObject& global_object)
|
||||
void DurationFormatPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class DurationFormatPrototype final : public PrototypeObject<DurationFormatProto
|
|||
|
||||
public:
|
||||
explicit DurationFormatPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DurationFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -33,9 +33,9 @@ Intl::Intl(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void Intl::initialize(GlobalObject& global_object)
|
||||
void Intl::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
@ -43,16 +43,16 @@ void Intl::initialize(GlobalObject& global_object)
|
|||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl"), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_direct_property(vm.names.Collator, global_object.intl_collator_constructor(), attr);
|
||||
define_direct_property(vm.names.DateTimeFormat, global_object.intl_date_time_format_constructor(), attr);
|
||||
define_direct_property(vm.names.DisplayNames, global_object.intl_display_names_constructor(), attr);
|
||||
define_direct_property(vm.names.DurationFormat, global_object.intl_duration_format_constructor(), attr);
|
||||
define_direct_property(vm.names.ListFormat, global_object.intl_list_format_constructor(), attr);
|
||||
define_direct_property(vm.names.Locale, global_object.intl_locale_constructor(), attr);
|
||||
define_direct_property(vm.names.NumberFormat, global_object.intl_number_format_constructor(), attr);
|
||||
define_direct_property(vm.names.PluralRules, global_object.intl_plural_rules_constructor(), attr);
|
||||
define_direct_property(vm.names.RelativeTimeFormat, global_object.intl_relative_time_format_constructor(), attr);
|
||||
define_direct_property(vm.names.Segmenter, global_object.intl_segmenter_constructor(), attr);
|
||||
define_direct_property(vm.names.Collator, realm.global_object().intl_collator_constructor(), attr);
|
||||
define_direct_property(vm.names.DateTimeFormat, realm.global_object().intl_date_time_format_constructor(), attr);
|
||||
define_direct_property(vm.names.DisplayNames, realm.global_object().intl_display_names_constructor(), attr);
|
||||
define_direct_property(vm.names.DurationFormat, realm.global_object().intl_duration_format_constructor(), attr);
|
||||
define_direct_property(vm.names.ListFormat, realm.global_object().intl_list_format_constructor(), attr);
|
||||
define_direct_property(vm.names.Locale, realm.global_object().intl_locale_constructor(), attr);
|
||||
define_direct_property(vm.names.NumberFormat, realm.global_object().intl_number_format_constructor(), attr);
|
||||
define_direct_property(vm.names.PluralRules, realm.global_object().intl_plural_rules_constructor(), attr);
|
||||
define_direct_property(vm.names.RelativeTimeFormat, realm.global_object().intl_relative_time_format_constructor(), attr);
|
||||
define_direct_property(vm.names.Segmenter, realm.global_object().intl_segmenter_constructor(), attr);
|
||||
|
||||
define_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr);
|
||||
define_native_function(vm.names.supportedValuesOf, supported_values_of, 1, attr);
|
||||
|
|
|
@ -15,7 +15,7 @@ class Intl final : public Object {
|
|||
|
||||
public:
|
||||
explicit Intl(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~Intl() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -20,14 +20,14 @@ ListFormatConstructor::ListFormatConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void ListFormatConstructor::initialize(GlobalObject& global_object)
|
||||
void ListFormatConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 13.2.1 Intl.ListFormat.prototype, https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_list_format_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_list_format_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
|
||||
|
|
|
@ -15,7 +15,7 @@ class ListFormatConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit ListFormatConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ListFormatConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -18,9 +18,9 @@ ListFormatPrototype::ListFormatPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void ListFormatPrototype::initialize(GlobalObject& global_object)
|
||||
void ListFormatPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class ListFormatPrototype final : public PrototypeObject<ListFormatPrototype, Li
|
|||
|
||||
public:
|
||||
explicit ListFormatPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ListFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -225,14 +225,14 @@ LocaleConstructor::LocaleConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void LocaleConstructor::initialize(GlobalObject& global_object)
|
||||
void LocaleConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 14.2.1 Intl.Locale.prototype, https://tc39.es/ecma402/#sec-Intl.Locale.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_locale_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_locale_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class LocaleConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit LocaleConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~LocaleConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -19,9 +19,9 @@ LocalePrototype::LocalePrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void LocalePrototype::initialize(GlobalObject& global_object)
|
||||
void LocalePrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class LocalePrototype final : public PrototypeObject<LocalePrototype, Locale> {
|
|||
|
||||
public:
|
||||
explicit LocalePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~LocalePrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,14 +19,14 @@ NumberFormatConstructor::NumberFormatConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void NumberFormatConstructor::initialize(GlobalObject& global_object)
|
||||
void NumberFormatConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 15.2.1 Intl.NumberFormat.prototype, https://tc39.es/ecma402/#sec-intl.numberformat.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_number_format_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_number_format_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
|
||||
|
|
|
@ -16,7 +16,7 @@ class NumberFormatConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit NumberFormatConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~NumberFormatConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -23,11 +23,11 @@ NumberFormatFunction::NumberFormatFunction(NumberFormat& number_format, Object&
|
|||
{
|
||||
}
|
||||
|
||||
void NumberFormatFunction::initialize(GlobalObject& global_object)
|
||||
void NumberFormatFunction::initialize(Realm& realm)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
Base::initialize(global_object);
|
||||
Base::initialize(realm);
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
define_direct_property(vm.names.name, js_string(vm, String::empty()), Attribute::Configurable);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
explicit NumberFormatFunction(NumberFormat&, Object& prototype);
|
||||
virtual ~NumberFormatFunction() override = default;
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ NumberFormatPrototype::NumberFormatPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void NumberFormatPrototype::initialize(GlobalObject& global_object)
|
||||
void NumberFormatPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class NumberFormatPrototype final : public PrototypeObject<NumberFormatPrototype
|
|||
|
||||
public:
|
||||
explicit NumberFormatPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~NumberFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -21,14 +21,14 @@ PluralRulesConstructor::PluralRulesConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void PluralRulesConstructor::initialize(GlobalObject& global_object)
|
||||
void PluralRulesConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 16.2.1 Intl.PluralRules.prototype, https://tc39.es/ecma402/#sec-intl.pluralrules.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_plural_rules_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_plural_rules_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
|
|
@ -15,7 +15,7 @@ class PluralRulesConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit PluralRulesConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PluralRulesConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -18,9 +18,9 @@ PluralRulesPrototype::PluralRulesPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void PluralRulesPrototype::initialize(GlobalObject& global_object)
|
||||
void PluralRulesPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class PluralRulesPrototype final : public PrototypeObject<PluralRulesPrototype,
|
|||
|
||||
public:
|
||||
explicit PluralRulesPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PluralRulesPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -24,14 +24,14 @@ RelativeTimeFormatConstructor::RelativeTimeFormatConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void RelativeTimeFormatConstructor::initialize(GlobalObject& global_object)
|
||||
void RelativeTimeFormatConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 17.2.1 Intl.RelativeTimeFormat.prototype, https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_relative_time_format_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_relative_time_format_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
|
|
@ -15,7 +15,7 @@ class RelativeTimeFormatConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit RelativeTimeFormatConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~RelativeTimeFormatConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -16,9 +16,9 @@ RelativeTimeFormatPrototype::RelativeTimeFormatPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void RelativeTimeFormatPrototype::initialize(GlobalObject& global_object)
|
||||
void RelativeTimeFormatPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class RelativeTimeFormatPrototype final : public PrototypeObject<RelativeTimeFor
|
|||
|
||||
public:
|
||||
explicit RelativeTimeFormatPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~RelativeTimeFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -18,14 +18,14 @@ SegmentIteratorPrototype::SegmentIteratorPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void SegmentIteratorPrototype::initialize(GlobalObject& global_object)
|
||||
void SegmentIteratorPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 18.6.2.2 %SegmentIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma402/#sec-%segmentiteratorprototype%.@@tostringtag
|
||||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Segmenter String Iterator"), Attribute::Configurable);
|
||||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Segmenter String Iterator"), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.next, next, 0, attr);
|
||||
|
|
|
@ -16,7 +16,7 @@ class SegmentIteratorPrototype final : public PrototypeObject<SegmentIteratorPro
|
|||
|
||||
public:
|
||||
explicit SegmentIteratorPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmentIteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -20,14 +20,14 @@ SegmenterConstructor::SegmenterConstructor(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void SegmenterConstructor::initialize(GlobalObject& global_object)
|
||||
void SegmenterConstructor::initialize(Realm& realm)
|
||||
{
|
||||
NativeFunction::initialize(global_object);
|
||||
NativeFunction::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 18.2.1 Intl.Segmenter.prototype, https://tc39.es/ecma402/#sec-intl.segmenter.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.intl_segmenter_prototype(), 0);
|
||||
define_direct_property(vm.names.prototype, realm.global_object().intl_segmenter_prototype(), 0);
|
||||
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
|
|
|
@ -15,7 +15,7 @@ class SegmenterConstructor final : public NativeFunction {
|
|||
|
||||
public:
|
||||
explicit SegmenterConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmenterConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
|
|
@ -17,9 +17,9 @@ SegmenterPrototype::SegmenterPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void SegmenterPrototype::initialize(GlobalObject& global_object)
|
||||
void SegmenterPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SegmenterPrototype final : public PrototypeObject<SegmenterPrototype, Segm
|
|||
|
||||
public:
|
||||
explicit SegmenterPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmenterPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
|
@ -17,9 +17,9 @@ SegmentsPrototype::SegmentsPrototype(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
void SegmentsPrototype::initialize(GlobalObject& global_object)
|
||||
void SegmentsPrototype::initialize(Realm& realm)
|
||||
{
|
||||
Object::initialize(global_object);
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SegmentsPrototype final : public PrototypeObject<SegmentsPrototype, Segmen
|
|||
|
||||
public:
|
||||
explicit SegmentsPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmentsPrototype() override = default;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue