Skip to content

Commit 55a3fcd

Browse files
gibson04212wrigja
authored andcommitted
Sync ToSecondsStringPrecision with spec
UPSTREAM_COMMIT=8acce003bd6dbb689c76117b7e5c851de75ce4a1
1 parent 5e05966 commit 55a3fcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ecmascript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,10 @@ export function ToSecondsStringPrecision(options: Temporal.ToStringPrecisionOpti
956956
if (stringDigits === 'auto') return { precision: 'auto', unit: 'nanosecond', increment: 1 };
957957
throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${stringDigits}`);
958958
}
959-
if (NumberIsNaN(digits) || digits < 0 || digits > 9) {
959+
const precision = ToInteger(digits);
960+
if (!NumberIsFinite(digits) || precision < 0 || precision > 9) {
960961
throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${digits}`);
961962
}
962-
const precision = MathFloor(digits);
963963
switch (precision) {
964964
case 0:
965965
return { precision, unit: 'second', increment: 1 };

0 commit comments

Comments
 (0)