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
3. Let mxfd be ? Get(options, "maximumFractionDigits").
...
ii. Set mxfd to ? DefaultNumberOption(mxfd, 0, 100, undefined).
iii. If mnfd is undefined, set mnfd to min(mnfdDefault, mxfd).
At this point, mxfd can be undefined which makes the operation min(mnfdDefault, mxfd) ambiguous. How should I handle this case?
If mnfd is undefined, then mxfd is guaranteed to be non-undefined, because if both are undefined, then hasFd is set to false and step 23 isn't entered.
Right; hasFd means that either mnfd or mxfd is not undefined, so mnfd is undefined implies mxfd is not undefined and vice versa.
I'd be open to a comment or an assertion. If an assertion is used, we should add assertions throughout SetNumberFormatDigitOptions. I think I lean toward a comment in this case.
In https://tc39.es/ecma402/#sec-setnfdigitoptions 23.a.iii the sequence to set
mnfd
is ambiguous whenmxfd
isundefined
.At this point,
mxfd
can beundefined
which makes the operationmin(mnfdDefault, mxfd)
ambiguous. How should I handle this case?Ref: formatjs/formatjs#4678
The text was updated successfully, but these errors were encountered: