Debian Codegraph @

js/src/tests/test262/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/options-null.js

raw
1 // Copyright 2018 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.RelativeTimeFormat.supportedLocalesOf
6 description: Checks handling of a null options argument to the supportedLocalesOf function.
7 info: |
8 SupportedLocales ( availableLocales, requestedLocales, options )
9
10 1. If options is not undefined, then
11 a. Let options be ? ToObject(options).
12 features: [Intl.RelativeTimeFormat]
13 ---*/
14
15 assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
16 "Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
17
18 assert.throws(TypeError, function() {
19 Intl.RelativeTimeFormat.supportedLocalesOf([], null);
20 }, "Should throw when passing null as the options argument");
21
22 reportCompare(0, 0);