summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js
blob: f476c362515f9ac29a6289c4781de4dcc4b7a01d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// |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: Verifies the type of the return value of Intl.Segmenter.supportedLocalesOf().
info: |
    Intl.Segmenter.supportedLocalesOf ( locales [, options ])
includes: [propertyHelper.js]
features: [Intl.Segmenter]
---*/

const result = Intl.Segmenter.supportedLocalesOf("en");
assert.sameValue(Array.isArray(result), true,
  "Array.isArray() should return true");
assert.sameValue(Object.getPrototypeOf(result), Array.prototype,
  "The prototype should be Array.prototype");
assert.sameValue(Object.isExtensible(result), true,
  "Object.isExtensible() should return true");

assert.notSameValue(result.length, 0);
for (let i = 0; i < result.length; ++i) {
  verifyProperty(result, String(i), {
    "writable": true,
    "enumerable": true,
    "configurable": true,
  });
}

verifyProperty(result, "length", {
  "enumerable": false,
  "configurable": false,
});

reportCompare(0, 0);