get-locale.js (631B)
1 // Copyright 2016 Mozilla Corporation. All rights reserved. 2 // This code is governed by the license found in the LICENSE file. 3 4 /*--- 5 esid: sec-intl.getcanonicallocales 6 description: Test Intl.getCanonicalLocales for step 7.c.i. 7 info: | 8 9.2.1 CanonicalizeLocaleList (locales) 9 7. Repeat, while k < len. 10 c. If kPresent is true, then 11 i. Let kValue be ? Get(O, Pk). 12 ---*/ 13 14 var locales = { 15 '0': 'en-US', 16 length: 2 17 }; 18 19 Object.defineProperty(locales, "1", { 20 get: function() { throw new Test262Error() } 21 }); 22 23 assert.throws(Test262Error, function() { 24 Intl.getCanonicalLocales(locales); 25 }); 26 27 reportCompare(0, 0);