You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Temporal should not coerce fractionalSecondDigits #4038
Given that GetTemporalFractionalSecondDigitsOption is already out of sync with ECMA-4021, can we tighten it up to reject non-integer numbers rather than coercing them?
1. If _digitsValue_ is not a Number, then
1. If ? ToString(_digitsValue_) is not *"auto"*, throw a *RangeError* exception.
1. Return ~auto~.
- 1. If _digitsValue_ is not a finite Number, throw a *RangeError* exception.- 1. Let _digitCount_ be floor(ℝ(_digitsValue_)).- 1. If _digitCount_ is not in the inclusive interval from 0 to 9, throw a *RangeError* exception.- 1. Return _digitCount_.+ 1. Return ? SnapToInteger(_digitsValue_, ~reject~, 0, 9)
Temporal is sufficiently new that it seems unlikely for such a normative change of unexpected input to disrupt existing code.
Footnotes
in which e.g. new Intl.DurationFormat("en", { seconds: "numeric", fractionalDigits: 9.1 }).resolvedOptions().fractionalDigits throws but new Intl.DurationFormat("en", { seconds: "numeric", fractionalDigits: 8.9 }).resolvedOptions().fractionalDigits is 8 because DefaultNumberOption checks ℝ(value) against bounds before flooring, cf. https://github.com/tc39/ecma402/issues/691 and https://github.com/tc39/ecma402/pull/908↩
Activity