supported-locales.js (742B)
1 // |reftest| skip-if(!this.hasOwnProperty('Intl')) 2 3 // Intl.ListFormat.supportedLocalesOf returns an empty array for unsupported locales. 4 assertEq(Intl.ListFormat.supportedLocalesOf("art-lobjan").length, 0); 5 6 // And a non-empty array for supported locales. 7 assertEq(Intl.ListFormat.supportedLocalesOf("en").length, 1); 8 assertEq(Intl.ListFormat.supportedLocalesOf("en")[0], "en"); 9 10 // If the locale is supported per |Intl.ListFormat.supportedLocalesOf|, the resolved locale 11 // should reflect this. 12 for (let locale of Intl.ListFormat.supportedLocalesOf(["en", "de", "th", "ar"])) { 13 let lf = new Intl.ListFormat(locale); 14 assertEq(lf.resolvedOptions().locale, locale); 15 } 16 17 if (typeof reportCompare === "function") 18 reportCompare(0, 0);