-
Notifications
You must be signed in to change notification settings - Fork 17
no validation of value of extensions in tag? #81
Comments
I think this is a reasonable behavior tbh. We verify that the input language identifier string is well formed while we verify that the options are valid. We're consistent in that behavior. Long time ago we talked about an option to validate the input string as well, but that never came to fruition. |
then |
undefined
undefined I'm not opposed to liberating options to be well-formed only, in which case we'd also accept The reason why I think the current subset makes sense (until we complete it) is that options come from developers, so throwing on well-formed, but invalid value makes sense. |
Why, according to the current spec, the result is not "true" and "mom" ? That is the part I try to understand.
I am not lobbying for that. Just try to figure out what the current spec said.
|
We last discussed this topic in #19 . There, we decided to validate simply the grammar, and not the contents, in these contexts. Applying that decision here, I think we should return |
The correct results are: js> addIntlExtras(Intl) // Add Intl.Locale to Intl in SpiderMonkey shell
js> (new Intl.Locale("en-u-kf-true")).caseFirst
""
js> (new Intl.Locale("en-u-kf-mom")).caseFirst
"mom" The
|
Based on my read of the current spec and @anba's description, it seems like the current spec is correct and the behavior is as expected. Is it ok for me to close this issue? |
reopen if needed! |
I am not sure my observation is correct below. Need some help.
It seems to me, with the current spec, we will valid the value of options. For example, if we put in new Intl.Locale("en", {caseFirst: "true"}) or Intl.Loclae("en", {caseFirst: "mom"}) we will throw RangeError because we only pass « "upper", "lower", "false" » to GetOption in https://tc39.es/proposal-intl-locale/#sec-Intl.Locale which does not contains "true" or "mom"
However, what will happen if we call
new Intl.Locale("en-u-kf-true") or new Intl.Locale("en-u-kf-mom") ?
I somehow cannot see anywhere in the spec cause us to throw RangeError.
Is that true, or is it because I missed something.
What should the expected result of
(new Intl.Locale("en-u-kf-true")).caseFirst and
(new Intl.Locale("en-u-kf-mom")).caseFirst ?
@littledan @sffc @Ms2ger @zbraniecki @anba
The text was updated successfully, but these errors were encountered: