mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
parent
d159938acc
commit
5516ad7158
3 changed files with 5 additions and 4 deletions
|
@ -37,6 +37,7 @@ namespace JS {
|
|||
P(Math) \
|
||||
P(NEGATIVE_INFINITY) \
|
||||
P(NaN) \
|
||||
P(Now) \
|
||||
P(Number) \
|
||||
P(PI) \
|
||||
P(POSITIVE_INFINITY) \
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace JS::Temporal {
|
||||
|
||||
// 2 The Temporal.now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object
|
||||
// 2 The Temporal.Now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object
|
||||
Now::Now(GlobalObject& global_object)
|
||||
: Object(*global_object.object_prototype())
|
||||
{
|
||||
|
@ -30,14 +30,14 @@ void Now::initialize(GlobalObject& global_object)
|
|||
define_native_function(vm.names.instant, instant, 0, attr);
|
||||
}
|
||||
|
||||
// 2.1.1 Temporal.now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone
|
||||
// 2.1.1 Temporal.Now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone
|
||||
JS_DEFINE_NATIVE_FUNCTION(Now::time_zone)
|
||||
{
|
||||
// 1. Return ! SystemTimeZone().
|
||||
return system_time_zone(global_object);
|
||||
}
|
||||
|
||||
// 2.1.2 Temporal.now.instant ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.instant
|
||||
// 2.1.2 Temporal.Now.instant ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.instant
|
||||
JS_DEFINE_NATIVE_FUNCTION(Now::instant)
|
||||
{
|
||||
// 1. Return ! SystemInstant().
|
||||
|
|
|
@ -27,7 +27,7 @@ void Temporal::initialize(GlobalObject& global_object)
|
|||
auto& vm = this->vm();
|
||||
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, global_object), 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue