LibJS: Replace RoundTowardsZero with truncate

This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/409ab66
This commit is contained in:
Timothy Flynn
2022-10-14 09:29:16 -04:00
committed by Linus Groh
parent 019211bcb4
commit 4fbec2e8b3
6 changed files with 12 additions and 12 deletions

View File

@@ -381,7 +381,7 @@ ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision(VM& vm, Ob
if (fractional_digits_value.is_nan() || fractional_digits_value.is_infinity())
return vm.template throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, fractional_digits_value, "fractionalSecondDigits"sv);
// 12. Let fractionalDigitCount be RoundTowardsZero((fractionalDigitsVal)).
// 12. Let fractionalDigitCount be truncate((fractionalDigitsVal)).
auto fractional_digit_count_unchecked = trunc(fractional_digits_value.as_double());
// 13. If fractionalDigitCount < 0 or fractionalDigitCount > 9, throw a RangeError exception.