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 }}
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
#43 used RangeError when other date-time options are used with timeStyle/dateStyle, but TypeError is probably the more accurate error type here.
ECMA-402 currently uses RangeError whenever a value isn't a member of the set of allowed values:
A value can't be parsed correctly (language tags, currencies, units, etc.).
A given value isn't in the set of allowed values (GetOption operation).
A value is outside the range of allowed values (NaN or infinite).
Whereas TypeError is used when a value:
A value has an incorrect type (CanonicalizeLocaleList operation).
An expected value is missing (currency or unit in SetNumberFormatUnitOptions).
Interpreting that the set of allowed values for the date/time options is reduced to the empty set when timeStyle/dateStyle are present and therefore RangeError is the correct error type is maybe a bit dubious. I'd rather see it more similar to the missing unit or currency case in SetNumberFormatUnitOptions, where a user provided a logically incorrect options object.
The text was updated successfully, but these errors were encountered:
#43 used
RangeError
when other date-time options are used withtimeStyle
/dateStyle
, butTypeError
is probably the more accurate error type here.ECMA-402 currently uses
RangeError
whenever a value isn't a member of the set of allowed values:GetOption
operation).NaN
or infinite).Whereas
TypeError
is used when a value:CanonicalizeLocaleList
operation).SetNumberFormatUnitOptions
).Interpreting that the set of allowed values for the date/time options is reduced to the empty set when
timeStyle
/dateStyle
are present and thereforeRangeError
is the correct error type is maybe a bit dubious. I'd rather see it more similar to the missingunit
orcurrency
case inSetNumberFormatUnitOptions
, where a user provided a logically incorrect options object.The text was updated successfully, but these errors were encountered: