test262 icon indicating copy to clipboard operation
test262 copied to clipboard

Add test for Intl.Locale from "und"

Open sffc opened this issue 7 months ago • 8 comments

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

sffc avatar Mar 31 '25 16:03 sffc

I don't see a reason why locale.language should not be "und" here.

srl295 avatar Mar 31 '25 16:03 srl295

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 avatar Mar 31 '25 16:03 zbraniecki

@zbraniecki just to note, the v8 behavior is undefined not "undefined":

> new Intl.Locale('und-Latn').language
undefined

srl295 avatar Mar 31 '25 16:03 srl295

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".

zbraniecki avatar Mar 31 '25 18:03 zbraniecki

track under https://g-issues.chromium.org/issues/407793302

FrankYFTang avatar Apr 01 '25 18:04 FrankYFTang

fix https://chromium-review.googlesource.com/c/v8/v8/+/6421525 under way

FrankYFTang avatar Apr 01 '25 19:04 FrankYFTang

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

sffc avatar Apr 01 '25 20:04 sffc

TG2 discussion and approval: https://github.com/tc39/ecma402/blob/main/meetings/notes-2025-04-03.md#add-test-for-intllocale-from-und-4444

sffc avatar Apr 03 '25 21:04 sffc