summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js')
-rw-r--r--js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js b/js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js
new file mode 100644
index 0000000000..99032e02c9
--- /dev/null
+++ b/js/src/tests/test262/intl402/Intl/getCanonicalLocales/get-locale.js
@@ -0,0 +1,27 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-intl.getcanonicallocales
+description: Test Intl.getCanonicalLocales for step 7.c.i.
+info: |
+ 9.2.1 CanonicalizeLocaleList (locales)
+ 7. Repeat, while k < len.
+ c. If kPresent is true, then
+ i. Let kValue be ? Get(O, Pk).
+---*/
+
+var locales = {
+ '0': 'en-US',
+ length: 2
+};
+
+Object.defineProperty(locales, "1", {
+ get: function() { throw new Test262Error() }
+});
+
+assert.throws(Test262Error, function() {
+ Intl.getCanonicalLocales(locales);
+});
+
+reportCompare(0, 0);