summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/invoked-as-func.js
blob: b08abc7d26d84c12477c5f4559d92c7df1f0932e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-Intl.NumberFormat-NumberFormat
description: basic tests internal slot initialization and call receiver errors
info: |
  Intl.NumberFormat.prototype.formatRange(start, end )
  (...)
  2. Perform ? RequireInternalSlot(nf, [[InitializedNumberFormat]])
features: [Intl.NumberFormat-v3]
---*/

const nf = new Intl.NumberFormat();

// Perform ? RequireInternalSlot(nf, [[InitializedNumberFormat]])
let f = nf['formatRange'];

assert.sameValue(typeof f, 'function');
assert.throws(TypeError, () => { f(1, 23) });

reportCompare(0, 0);