unicode-bcp47-locale-ids-unicode-ext.js (492B)
1 // |reftest| skip-if(!this.hasOwnProperty("Intl")) 2 3 // Unicode locale extension sequences don't allow keys with a digit as their 4 // second character. 5 assertThrowsInstanceOf(() => Intl.getCanonicalLocales("en-u-c0"), RangeError); 6 assertThrowsInstanceOf(() => Intl.getCanonicalLocales("en-u-00"), RangeError); 7 8 // The first character is allowed to be a digit. 9 assertEq(Intl.getCanonicalLocales("en-u-0c")[0], "en-u-0c"); 10 11 if (typeof reportCompare === "function") 12 reportCompare(true, true);