Debian Codegraph @

js/src/tests/test262/intl402/DurationFormat/supportedLocalesOf/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.supportedLocalesOf
7 description: Checks error cases for the locales argument to the supportedLocalesOf function.
8 info: |
9 Intl.DurationFormat.supportedLocalesOf ( locales [, options ])
10 (...)
11 2. Let requestedLocales be CanonicalizeLocaleList(locales).
12 includes: [testIntl.js]
13 features: [Intl.DurationFormat]
14 ---*/
15
16 assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function",
17 "Should support Intl.DurationFormat.supportedLocalesOf.");
18
19 for (const [locales, expectedError] of getInvalidLocaleArguments()) {
20 assert.throws(expectedError, () => Intl.DurationFormat.supportedLocalesOf(locales));
21 }
22
23 reportCompare(0, 0);