anba commented on May 18
Intl.DisplayNames.prototype.of was recently (#67) changed to use plain ToString to convert the input. This makes Intl.DisplayNames inconsistent with CanonicalizeLocaleList, which only allows String and Object inputs to avoid accepting NaN as "nan".
js> new Intl.DisplayNames("en", {type: "language"}).of(NaN)
"Min Nan Chinese"
But we didn't care about this case anymore when specifiying Intl.Locale:
js> new Intl.Locale("und", {language: NaN}).toString()
"nan"
so maybe unconditionally calling ToString is okay. We should just make sure everybody is on board with this decision.
Moved from https://github.com/tc39/proposal-intl-displaynames/issues/71 of v1 repo
anba commented on May 18 Intl.DisplayNames.prototype.of was recently (#67) changed to use plain ToString to convert the input. This makes Intl.DisplayNames inconsistent with CanonicalizeLocaleList, which only allows String and Object inputs to avoid accepting NaN as "nan".
js> new Intl.DisplayNames("en", {type: "language"}).of(NaN) "Min Nan Chinese" But we didn't care about this case anymore when specifiying Intl.Locale:
js> new Intl.Locale("und", {language: NaN}).toString() "nan" so maybe unconditionally calling ToString is okay. We should just make sure everybody is on board with this decision.