supportedLocalesOf-taint-Array-2.js (914B)
1 // Copyright 2012 Mozilla Corporation. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 9.2.6_2 6 description: > 7 Tests that the behavior of a List is not affected by adversarial 8 changes to Array.prototype. 9 author: Norbert Lindenberg 10 includes: [testIntl.js] 11 ---*/ 12 13 taintArray(); 14 15 testWithIntlConstructors(function (Constructor) { 16 // this test should work equally for both matching algorithms 17 ["lookup", "best fit"].forEach(function (matcher) { 18 var defaultLocale = new Constructor().resolvedOptions().locale; 19 var canonicalized = Constructor.supportedLocalesOf([defaultLocale, defaultLocale], 20 {localeMatcher: matcher}); 21 assert.sameValue(canonicalized.length > 1, false, "Canonicalization with matcher " + matcher + " didn't remove duplicate language tags from locale list."); 22 }); 23 }); 24 25 reportCompare(0, 0);