tc39 / proposal-intl-numberformat-v3

Additional features for Intl.NumberFormat to solve key pain points.
MIT License
53 stars 12 forks source link

useGrouping's Note is inconsistent with the actual code #111

Closed Constellation closed 1 year ago

Constellation commented 2 years ago

https://github.com/tc39/proposal-intl-numberformat-v3/commit/4751da5c9c326f96a074b67ac5a8ecffe3440617

The note in this change says,

NOTE: For historical reasons, the strings "true" and "false" are treated the same as the boolean value true.

But because the following change is returning fallback, it is not the same to boolean true.

1. If _value_ is *"true"* or *"false"*, return _fallback_.
1. If _values_ does not contain an element equal to _value_, throw a *RangeError* exception.
  1. If the note is the intention, then fallback should be changed to trueValue.
  2. If the code is the intention, then we need to fix Note's comment.
sffc commented 2 years ago

Good catch. I assume no one cares too much about which option we choose between 1 and 2, so I'm inclined to go with option 2 (fix the note, no normative change).