Debian Codegraph @

js/src/tests/test262/intl402/Intl/getCanonicalLocales/elements-not-reordered.js

raw
1 // Copyright (C) 2017 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-intl.getcanonicallocales
6 description: >
7 Language tags are not reordered.
8 info: |
9 8.2.1 Intl.getCanonicalLocales (locales)
10 1. Let ll be ? CanonicalizeLocaleList(locales).
11 2. Return CreateArrayFromList(ll).
12
13 9.2.1 CanonicalizeLocaleList (locales)
14 ...
15 7. Repeat, while k < len
16 ...
17 c. If kPresent is true, then
18 ...
19 vi. If canonicalizedTag is not an element of seen, append canonicalizedTag as the last element of seen.
20 ...
21 ---*/
22
23 var canonicalLocales = Intl.getCanonicalLocales(["zu", "af"]);
24
25 assert.sameValue(canonicalLocales.length, 2);
26 assert.sameValue(canonicalLocales[0], "zu");
27 assert.sameValue(canonicalLocales[1], "af");
28
29 reportCompare(0, 0);