tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

constructor-locales-string.js (1089B)


      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 passing a string value to the Intl.NumberFormat constructor is
      8  equivalent to passing an Array containing the same string value.
      9 info: |
     10  9.2.1 CanonicalizeLocaleList ( locales )
     11 
     12  3 .If Type(locales) is String, then
     13    a. Let O be CreateArrayFromList(« locales »).
     14 ---*/
     15 
     16 const actual = Intl.NumberFormat('en-US').resolvedOptions();
     17 const expected = Intl.NumberFormat(['en-US']).resolvedOptions();
     18 
     19 assert.sameValue(actual.locale, expected.locale);
     20 assert.sameValue(actual.minimumIntegerDigits, expected.minimumIntegerDigits);
     21 assert.sameValue(actual.minimumFractionDigits, expected.minimumFractionDigits);
     22 assert.sameValue(actual.maximumFractionDigits, expected.maximumFractionDigits);
     23 assert.sameValue(actual.numberingSystem, expected.numberingSystem);
     24 assert.sameValue(actual.style, expected.style);
     25 assert.sameValue(actual.useGrouping, expected.useGrouping);
     26 
     27 reportCompare(0, 0);