LibJS: Use the newly added remainder operation in GetISOPartsFromEpoch

This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/b7bdc65
This commit is contained in:
Linus Groh 2021-09-02 21:42:48 +01:00
parent 97cc8f4613
commit 86a7c795f6
Notes: sideshowbarker 2024-07-18 04:28:26 +09:00

View file

@ -121,7 +121,7 @@ TimeZone* create_temporal_time_zone(GlobalObject& global_object, String const& i
// 11.6.3 GetISOPartsFromEpoch ( epochNanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-getisopartsfromepoch
Optional<ISODateTime> get_iso_parts_from_epoch(BigInt const& epoch_nanoseconds)
{
// 1. Let remainderNs be epochNanoseconds modulo 10^6.
// 1. Let remainderNs be remainder(epochNanoseconds, 10^6).
auto remainder_ns_bigint = epoch_nanoseconds.big_integer().divided_by(Crypto::UnsignedBigInteger { 1'000'000 }).remainder;
auto remainder_ns = remainder_ns_bigint.to_base(10).to_int<i64>().value();