summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js
blob: a46eba475ef45fc398b5156865404b96ceb6f281 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// |reftest| skip-if(!this.hasOwnProperty("Intl"))

// Unicode locale extension sequences don't allow keys with a digit as their
// second character.
assertThrowsInstanceOf(() => Intl.getCanonicalLocales("en-u-c0"), RangeError);
assertThrowsInstanceOf(() => Intl.getCanonicalLocales("en-u-00"), RangeError);

// The first character is allowed to be a digit.
assertEq(Intl.getCanonicalLocales("en-u-0c")[0], "en-u-0c");

if (typeof reportCompare === "function")
    reportCompare(true, true);