tor-browser

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

constructor-locales-invalid.js (634B)


      1 // Copyright 2022 Igalia, S.L. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-Intl.DurationFormat
      6 description: Checks error cases for the locales argument to the DurationFormat constructor.
      7 info: |
      8    Intl.DurationFormat  ( [ locales [ , options ] ] )
      9    (...)
     10    3. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
     11 includes: [testIntl.js]
     12 features: [Intl.DurationFormat]
     13 ---*/
     14 
     15 for (const [locales, expectedError] of getInvalidLocaleArguments()) {
     16    assert.throws(expectedError, function() { new Intl.DurationFormat(locales) })
     17 }
     18 
     19 reportCompare(0, 0);