summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-null.js
blob: f97ad6627fa80087586dac820e667100cfcf488c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// |reftest| skip-if(!Intl.Segmenter) -- Intl.Segmenter is not enabled unconditionally
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-Intl.Segmenter.supportedLocalesOf
description: Checks handling of a null options argument to the supportedLocalesOf function.
info: |
    SupportedLocales ( availableLocales, requestedLocales, options )

    1. If options is not undefined, then
        a. Let options be ? ToObject(options).
features: [Intl.Segmenter]
---*/

assert.sameValue(typeof Intl.Segmenter.supportedLocalesOf, "function",
                 "Should support Intl.Segmenter.supportedLocalesOf.");

assert.throws(TypeError, function() {
  Intl.Segmenter.supportedLocalesOf([], null);
}, "Should throw when passing null as the options argument");

reportCompare(0, 0);