mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:17:44 +00:00
LibJS+LibWeb: Replace GlobalObject with Realm in object constructors
No functional changes - we can still very easily get to the global object via `Realm::global_object()`. This is in preparation of moving the intrinsics to the realm and no longer having to pass a global object when allocating any object. In a few (now, and many more in subsequent commits) places we get a realm using `GlobalObject::associated_realm()`, this is intended to be temporary. For example, create() functions will later receive the same treatment and are passed a realm instead of a global object.
This commit is contained in:
parent
4c300cc5e8
commit
ecd163bdf1
315 changed files with 592 additions and 554 deletions
|
@ -11,8 +11,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 12.2 The Temporal.Calendar Constructor, https://tc39.es/proposal-temporal/#sec-temporal-calendar-constructor
|
||||
CalendarConstructor::CalendarConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.Calendar.as_string(), *global_object.function_prototype())
|
||||
CalendarConstructor::CalendarConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.Calendar.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class CalendarConstructor final : public NativeFunction {
|
|||
JS_OBJECT(CalendarConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit CalendarConstructor(GlobalObject&);
|
||||
explicit CalendarConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~CalendarConstructor() override = default;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 12.4 Properties of the Temporal.Calendar Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-calendar-prototype-object
|
||||
CalendarPrototype::CalendarPrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
CalendarPrototype::CalendarPrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class CalendarPrototype final : public PrototypeObject<CalendarPrototype, Calend
|
|||
JS_PROTOTYPE_OBJECT(CalendarPrototype, Calendar, Temporal.Calendar);
|
||||
|
||||
public:
|
||||
explicit CalendarPrototype(GlobalObject&);
|
||||
explicit CalendarPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~CalendarPrototype() override = default;
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor
|
||||
DurationConstructor::DurationConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.Duration.as_string(), *global_object.function_prototype())
|
||||
DurationConstructor::DurationConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.Duration.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class DurationConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DurationConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DurationConstructor(GlobalObject&);
|
||||
explicit DurationConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~DurationConstructor() override = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 7.3 Properties of the Temporal.Duration Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-duration-prototype-object
|
||||
DurationPrototype::DurationPrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
DurationPrototype::DurationPrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class DurationPrototype final : public PrototypeObject<DurationPrototype, Durati
|
|||
JS_PROTOTYPE_OBJECT(DurationPrototype, Duration, Temporal.Duration);
|
||||
|
||||
public:
|
||||
explicit DurationPrototype(GlobalObject&);
|
||||
explicit DurationPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~DurationPrototype() override = default;
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 8.1 The Temporal.Instant Constructor, https://tc39.es/proposal-temporal/#sec-temporal-instant-constructor
|
||||
InstantConstructor::InstantConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.Instant.as_string(), *global_object.function_prototype())
|
||||
InstantConstructor::InstantConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.Instant.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class InstantConstructor final : public NativeFunction {
|
|||
JS_OBJECT(InstantConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit InstantConstructor(GlobalObject&);
|
||||
explicit InstantConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~InstantConstructor() override = default;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 8.3 Properties of the Temporal.Instant Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-instant-prototype-object
|
||||
InstantPrototype::InstantPrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
InstantPrototype::InstantPrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class InstantPrototype final : public PrototypeObject<InstantPrototype, Instant>
|
|||
JS_PROTOTYPE_OBJECT(InstantPrototype, Instant, Temporal.Instant);
|
||||
|
||||
public:
|
||||
explicit InstantPrototype(GlobalObject&);
|
||||
explicit InstantPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~InstantPrototype() override = default;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 2 The Temporal.Now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object
|
||||
Now::Now(GlobalObject& global_object)
|
||||
: Object(*global_object.object_prototype())
|
||||
Now::Now(Realm& realm)
|
||||
: Object(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class Now final : public Object {
|
|||
JS_OBJECT(Now, Object);
|
||||
|
||||
public:
|
||||
explicit Now(GlobalObject&);
|
||||
explicit Now(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~Now() override = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 3.1 The Temporal.PlainDate Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-constructor
|
||||
PlainDateConstructor::PlainDateConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.PlainDate.as_string(), *global_object.function_prototype())
|
||||
PlainDateConstructor::PlainDateConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.PlainDate.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlainDateConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PlainDateConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PlainDateConstructor(GlobalObject&);
|
||||
explicit PlainDateConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainDateConstructor() override = default;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 3.3 Properties of the Temporal.PlainDate Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaindate-prototype-object
|
||||
PlainDatePrototype::PlainDatePrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
PlainDatePrototype::PlainDatePrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class PlainDatePrototype final : public PrototypeObject<PlainDatePrototype, Plai
|
|||
JS_PROTOTYPE_OBJECT(PlainDatePrototype, PlainDate, Temporal.PlainDate);
|
||||
|
||||
public:
|
||||
explicit PlainDatePrototype(GlobalObject&);
|
||||
explicit PlainDatePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainDatePrototype() override = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 5.1 The Temporal.PlainDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-constructor
|
||||
PlainDateTimeConstructor::PlainDateTimeConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.PlainDateTime.as_string(), *global_object.function_prototype())
|
||||
PlainDateTimeConstructor::PlainDateTimeConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.PlainDateTime.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlainDateTimeConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PlainDateTimeConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PlainDateTimeConstructor(GlobalObject&);
|
||||
explicit PlainDateTimeConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainDateTimeConstructor() override = default;
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 5.3 Properties of the Temporal.PlainDateTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaindatetime-prototype-object
|
||||
PlainDateTimePrototype::PlainDateTimePrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
PlainDateTimePrototype::PlainDateTimePrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class PlainDateTimePrototype final : public PrototypeObject<PlainDateTimePrototy
|
|||
JS_PROTOTYPE_OBJECT(PlainDateTimePrototype, PlainDateTime, Temporal.PlainDateTime);
|
||||
|
||||
public:
|
||||
explicit PlainDateTimePrototype(GlobalObject&);
|
||||
explicit PlainDateTimePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainDateTimePrototype() override = default;
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 10.1 The Temporal.PlainMonthDay Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-constructor
|
||||
PlainMonthDayConstructor::PlainMonthDayConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.PlainMonthDay.as_string(), *global_object.function_prototype())
|
||||
PlainMonthDayConstructor::PlainMonthDayConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.PlainMonthDay.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlainMonthDayConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PlainMonthDayConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PlainMonthDayConstructor(GlobalObject&);
|
||||
explicit PlainMonthDayConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainMonthDayConstructor() override = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 10.3 Properties of the Temporal.PlainMonthDay Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plainmonthday-prototype-object
|
||||
PlainMonthDayPrototype::PlainMonthDayPrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
PlainMonthDayPrototype::PlainMonthDayPrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class PlainMonthDayPrototype final : public PrototypeObject<PlainMonthDayPrototy
|
|||
JS_PROTOTYPE_OBJECT(PlainMonthDayPrototype, PlainMonthDay, Temporal.PlainMonthDay);
|
||||
|
||||
public:
|
||||
explicit PlainMonthDayPrototype(GlobalObject&);
|
||||
explicit PlainMonthDayPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainMonthDayPrototype() override = default;
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 4.1 The Temporal.PlainTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-constructor
|
||||
PlainTimeConstructor::PlainTimeConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.PlainTime.as_string(), *global_object.function_prototype())
|
||||
PlainTimeConstructor::PlainTimeConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.PlainTime.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlainTimeConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PlainTimeConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PlainTimeConstructor(GlobalObject&);
|
||||
explicit PlainTimeConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainTimeConstructor() override = default;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 4.3 Properties of the Temporal.PlainTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaintime-prototype-object
|
||||
PlainTimePrototype::PlainTimePrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
PlainTimePrototype::PlainTimePrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class PlainTimePrototype final : public PrototypeObject<PlainTimePrototype, Plai
|
|||
JS_PROTOTYPE_OBJECT(PlainTimePrototype, PlainTime, Temporal.PlainTime);
|
||||
|
||||
public:
|
||||
explicit PlainTimePrototype(GlobalObject&);
|
||||
explicit PlainTimePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainTimePrototype() override = default;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 9.1 The Temporal.PlainYearMonth Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-constructor
|
||||
PlainYearMonthConstructor::PlainYearMonthConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.PlainYearMonth.as_string(), *global_object.function_prototype())
|
||||
PlainYearMonthConstructor::PlainYearMonthConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.PlainYearMonth.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlainYearMonthConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PlainYearMonthConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PlainYearMonthConstructor(GlobalObject&);
|
||||
explicit PlainYearMonthConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainYearMonthConstructor() override = default;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 9.3 Properties of the Temporal.PlainYearMonth Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plainyearmonth-prototype-object
|
||||
PlainYearMonthPrototype::PlainYearMonthPrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
PlainYearMonthPrototype::PlainYearMonthPrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class PlainYearMonthPrototype final : public PrototypeObject<PlainYearMonthProto
|
|||
JS_PROTOTYPE_OBJECT(PlainYearMonthPrototype, PlainYearMonth, Temporal.PlainYearMonth);
|
||||
|
||||
public:
|
||||
explicit PlainYearMonthPrototype(GlobalObject&);
|
||||
explicit PlainYearMonthPrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~PlainYearMonthPrototype() override = default;
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 1 The Temporal Object, https://tc39.es/proposal-temporal/#sec-temporal-objects
|
||||
Temporal::Temporal(GlobalObject& global_object)
|
||||
: Object(*global_object.object_prototype())
|
||||
Temporal::Temporal(Realm& realm)
|
||||
: Object(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -31,12 +31,13 @@ void Temporal::initialize(GlobalObject& global_object)
|
|||
Object::initialize(global_object);
|
||||
|
||||
auto& vm = this->vm();
|
||||
auto& realm = *global_object.associated_realm();
|
||||
|
||||
// 1.1.1 Temporal [ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal-@@tostringtag
|
||||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal"), Attribute::Configurable);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_direct_property(vm.names.Now, heap().allocate<Now>(global_object, global_object), attr);
|
||||
define_direct_property(vm.names.Now, heap().allocate<Now>(global_object, realm), attr);
|
||||
define_direct_property(vm.names.Calendar, global_object.temporal_calendar_constructor(), attr);
|
||||
define_direct_property(vm.names.Duration, global_object.temporal_duration_constructor(), attr);
|
||||
define_direct_property(vm.names.Instant, global_object.temporal_instant_constructor(), attr);
|
||||
|
|
|
@ -14,7 +14,7 @@ class Temporal final : public Object {
|
|||
JS_OBJECT(Temporal, Object);
|
||||
|
||||
public:
|
||||
explicit Temporal(GlobalObject&);
|
||||
explicit Temporal(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~Temporal() override = default;
|
||||
};
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 11.2 The Temporal.TimeZone Constructor, https://tc39.es/proposal-temporal/#sec-temporal-timezone-constructor
|
||||
TimeZoneConstructor::TimeZoneConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.TimeZone.as_string(), *global_object.function_prototype())
|
||||
TimeZoneConstructor::TimeZoneConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.TimeZone.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class TimeZoneConstructor final : public NativeFunction {
|
|||
JS_OBJECT(TimeZoneConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit TimeZoneConstructor(GlobalObject&);
|
||||
explicit TimeZoneConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~TimeZoneConstructor() override = default;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 11.4 Properties of the Temporal.TimeZone Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-timezone-prototype-object
|
||||
TimeZonePrototype::TimeZonePrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
TimeZonePrototype::TimeZonePrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class TimeZonePrototype final : public PrototypeObject<TimeZonePrototype, TimeZo
|
|||
JS_PROTOTYPE_OBJECT(TimeZonePrototype, TimeZone, Temporal.TimeZone);
|
||||
|
||||
public:
|
||||
explicit TimeZonePrototype(GlobalObject&);
|
||||
explicit TimeZonePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~TimeZonePrototype() override = default;
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 6.1 The Temporal.ZonedDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-constructor
|
||||
ZonedDateTimeConstructor::ZonedDateTimeConstructor(GlobalObject& global_object)
|
||||
: NativeFunction(vm().names.ZonedDateTime.as_string(), *global_object.function_prototype())
|
||||
ZonedDateTimeConstructor::ZonedDateTimeConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.ZonedDateTime.as_string(), *realm.global_object().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class ZonedDateTimeConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ZonedDateTimeConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ZonedDateTimeConstructor(GlobalObject&);
|
||||
explicit ZonedDateTimeConstructor(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~ZonedDateTimeConstructor() override = default;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
// 6.3 Properties of the Temporal.ZonedDateTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-zoneddatetime-prototype-object
|
||||
ZonedDateTimePrototype::ZonedDateTimePrototype(GlobalObject& global_object)
|
||||
: PrototypeObject(*global_object.object_prototype())
|
||||
ZonedDateTimePrototype::ZonedDateTimePrototype(Realm& realm)
|
||||
: PrototypeObject(*realm.global_object().object_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class ZonedDateTimePrototype final : public PrototypeObject<ZonedDateTimePrototy
|
|||
JS_PROTOTYPE_OBJECT(ZonedDateTimePrototype, ZonedDateTime, Temporal.ZonedDateTime);
|
||||
|
||||
public:
|
||||
explicit ZonedDateTimePrototype(GlobalObject&);
|
||||
explicit ZonedDateTimePrototype(Realm&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~ZonedDateTimePrototype() override = default;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue