|
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 * @description Tests that the behavior of a List is not affected by adversarial |
|
6 * changes to Array.prototype. |
|
7 * @author Norbert Lindenberg |
|
8 */ |
|
9 |
|
10 $INCLUDE("testIntl.js"); |
|
11 |
|
12 taintArray(); |
|
13 |
|
14 testWithIntlConstructors(function (Constructor) { |
|
15 // this test should work equally for both matching algorithms |
|
16 ["lookup", "best fit"].forEach(function (matcher) { |
|
17 var defaultLocale = new Constructor().resolvedOptions().locale; |
|
18 var canonicalized = Constructor.supportedLocalesOf([defaultLocale, defaultLocale], |
|
19 {localeMatcher: matcher}); |
|
20 if (canonicalized.length > 1) { |
|
21 $ERROR("Canonicalization with matcher " + matcher + " didn't remove duplicate language tags from locale list."); |
|
22 } |
|
23 }); |
|
24 |
|
25 return true; |
|
26 }); |
|
27 |