1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

LibJS: Fix number types in GetISOPartsFromEpoch

This is an editorial change in the Temporal spec.

See: c5b645d

This means we now have to pass a global object and construct a BigInt
object just for the assertion, but oh well. We might want to have an
assertion macro that's optimized away in release builds at a later
point, however.
This commit is contained in:
Linus Groh 2022-03-25 18:33:55 +00:00
parent 9950f06623
commit a5ea066693
2 changed files with 17 additions and 14 deletions

View file

@ -40,7 +40,7 @@ String canonicalize_time_zone_name(String const& time_zone);
String default_time_zone();
ThrowCompletionOr<String> parse_temporal_time_zone(GlobalObject&, String const&);
ThrowCompletionOr<TimeZone*> create_temporal_time_zone(GlobalObject&, String const& identifier, FunctionObject const* new_target = nullptr);
ISODateTime get_iso_parts_from_epoch(BigInt const& epoch_nanoseconds);
ISODateTime get_iso_parts_from_epoch(GlobalObject&, Crypto::SignedBigInteger const& epoch_nanoseconds);
MarkedVector<BigInt*> get_iana_time_zone_epoch_value(GlobalObject&, StringView time_zone_identifier, i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond);
i64 get_iana_time_zone_offset_nanoseconds(BigInt const& epoch_nanoseconds, String const& time_zone_identifier);
BigInt* get_iana_time_zone_next_transition(GlobalObject&, BigInt const& epoch_nanoseconds, StringView time_zone_identifier);