Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/intl402/NumberFormat/dft-currency-mnfd-range-check-mxfd.js

raw
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // This code is governed by the license found in the LICENSE file.
3
4 /*---
5 esid: sec-setnfdigitoptions
6 description: >
7 When a currency is used in Intl.NumberFormat and minimumFractionDigits is
8 not provided, maximumFractionDigits should be range-checked against it.
9 ---*/
10
11 assert.throws(RangeError, () => new Intl.NumberFormat('en', {
12 style: 'currency',
13 currency: 'USD',
14 maximumFractionDigits: 1
15 }), 'CurrencyDigits(USD) == 1');
16
17 assert.throws(RangeError, () => new Intl.NumberFormat('en', {
18 style: 'currency',
19 currency: 'CLF',
20 maximumFractionDigits: 3
21 }), 'CurrencyDigits(CLF) == 3');