Debian Codegraph @

js/src/tests/test262/intl402/DurationFormat/constructor-locales-invalid.js

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