constructor-default-value.js (945B)
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 constructor for Intl.NumberFormat uses appropriate default 8 values for its arguments (locales and options). 9 ---*/ 10 11 const actual = new Intl.NumberFormat().resolvedOptions(); 12 const expected = new Intl.NumberFormat([], Object.create(null)).resolvedOptions(); 13 14 assert.sameValue(actual.locale, expected.locale); 15 assert.sameValue(actual.minimumIntegerDigits, expected.minimumIntegerDigits); 16 assert.sameValue(actual.minimumFractionDigits, expected.minimumFractionDigits); 17 assert.sameValue(actual.maximumFractionDigits, expected.maximumFractionDigits); 18 assert.sameValue(actual.numberingSystem, expected.numberingSystem); 19 assert.sameValue(actual.style, expected.style); 20 assert.sameValue(actual.useGrouping, expected.useGrouping); 21 22 reportCompare(0, 0);