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

LibJS: Fix Instant rounding modes

This is a normative change in the Temporal spec.

See: 0993b75
This commit is contained in:
Linus Groh 2022-06-15 00:58:04 +01:00
parent 1755d051fd
commit b2965cf204
3 changed files with 51 additions and 16 deletions

View file

@ -235,8 +235,8 @@ BigInt* round_temporal_instant(GlobalObject& global_object, BigInt const& nanose
increment_nanoseconds = increment;
}
// 8. Return RoundNumberToIncrement((ns), incrementNs, roundingMode).
return js_bigint(vm, round_number_to_increment(nanoseconds.big_integer(), increment_nanoseconds, rounding_mode));
// 8. Return RoundNumberToIncrementAsIfPositive((ns), incrementNs, roundingMode).
return js_bigint(vm, round_number_to_increment_as_if_positive(nanoseconds.big_integer(), increment_nanoseconds, rounding_mode));
}
// 8.5.9 TemporalInstantToString ( instant, timeZone, precision ), https://tc39.es/proposal-temporal/#sec-temporal-temporalinstanttostring