test262
test262 copied to clipboard
Add test for Intl.Locale from "und"
Browsers don't behave consistently. See https://github.com/keymanapp/keyman/issues/13610
A test should be added asserting the behavior of new Intl.Locale("und").
Whoever takes this issue should independently verify what the expected behavior should be in the spec of the following functions:
let locale = new Intl.Locale("und");
assert.sameValue(locale.language, "???")
assert.sameValue(locale.script, "???")
assert.sameValue(locale.region, "???")
assert.sameValue(locale.toString(), "???")
CC @srl295
I don't see a reason why locale.language should not be "und" here.
My read of the spec, and judgement, is also that it should be "und".
Rationale for the judgement: Assigning it a "name", and in english, makes no sense. It's a special "code", derived from an English word, not a abbreviated language name "undefined".
@zbraniecki just to note, the v8 behavior is undefined not "undefined":
> new Intl.Locale('und-Latn').language
undefined
Oh, I see. That's better!
I still prefer "und" to be returned over undefined, but I'm glad we're not returning a string "undefined".
track under https://g-issues.chromium.org/issues/407793302
fix https://chromium-review.googlesource.com/c/v8/v8/+/6421525 under way
I filed this issue on test262 because we should add tests, including "und" but also things like "und-Latn" and "und-u-hc-h12" which should all return "und" from .language
TG2 discussion and approval: https://github.com/tc39/ecma402/blob/main/meetings/notes-2025-04-03.md#add-test-for-intllocale-from-und-4444