summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js')
-rw-r--r--js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js
new file mode 100644
index 0000000000..a46eba475e
--- /dev/null
+++ b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-unicode-ext.js
@@ -0,0 +1,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);