Debian Codegraph @

js/src/tests/test262/intl402/NumberFormat/constructor-locales-arraylike.js

raw
1 // Copyright (C) 2018 Ujjwal Sharma. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-initializenumberformat
6 description: >
7 Tests that the Intl.NumberFormat constructor accepts Array-like values for the
8 locales argument and treats them well.
9 ---*/
10
11 const actual = Intl.NumberFormat({
12 length: 1,
13 0: 'en-US'
14 }).resolvedOptions();
15 const expected = Intl.NumberFormat(['en-US']).resolvedOptions();
16
17 assert.sameValue(actual.locale, expected.locale);
18 assert.sameValue(actual.minimumIntegerDigits, expected.minimumIntegerDigits);
19 assert.sameValue(actual.minimumFractionDigits, expected.minimumFractionDigits);
20 assert.sameValue(actual.maximumFractionDigits, expected.maximumFractionDigits);
21 assert.sameValue(actual.numberingSystem, expected.numberingSystem);
22 assert.sameValue(actual.style, expected.style);
23 assert.sameValue(actual.useGrouping, expected.useGrouping);
24
25 reportCompare(0, 0);