1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibJS: Reflect recent editorial changes in the Temporal proposal

See:

- 2148441
- 08c04cc
- b77da58
This commit is contained in:
Linus Groh 2021-07-19 00:20:34 +01:00
parent 5c77885873
commit d159938acc
5 changed files with 16 additions and 12 deletions

View file

@ -33,14 +33,14 @@ void Now::initialize(GlobalObject& global_object)
// 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().
// 1. Return ! SystemTimeZone().
return system_time_zone(global_object);
}
// 2.1.2 Temporal.now.instant ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.instant
JS_DEFINE_NATIVE_FUNCTION(Now::instant)
{
// 1. Return ? SystemInstant().
// 1. Return ! SystemInstant().
return system_instant(global_object);
}
@ -50,7 +50,7 @@ TimeZone* system_time_zone(GlobalObject& global_object)
// 1. Let identifier be ! DefaultTimeZone().
auto identifier = default_time_zone();
// 2. Return ? CreateTemporalTimeZone(identifier).
// 2. Return ! CreateTemporalTimeZone(identifier).
return create_temporal_time_zone(global_object, identifier);
}
@ -83,7 +83,7 @@ Instant* system_instant(GlobalObject& global_object)
// 1. Let ns be ! SystemUTCEpochNanoseconds().
auto* ns = system_utc_epoch_nanoseconds(global_object);
// 2. Return ? CreateTemporalInstant(ns).
// 2. Return ! CreateTemporalInstant(ns).
return create_temporal_instant(global_object, *ns);
}