summaryrefslogtreecommitdiff
path: root/deps/v8/test/test262/local-tests/test/intl402/NumberFormat/fraction-digit-options-read-once.js
blob: e7e37b873503fcc6c6eaab0d5fa1b274fac40483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the license found in the LICENSE file.

/*---
esid: ECMA-402 #sec-setnfdigitoptions
description: >
    The maximum and minimum fraction digits properties should be read from
    the options bag exactly once from the NumberFormat constructor.
    Regression test for https://bugs.chromium.org/p/v8/issues/detail?id=6015
include: [assert.js]
---*/

var minCounter = 0;
var maxCounter = 0;
new Intl.NumberFormat("en", { get minimumFractionDigits() { minCounter++ },
                              get maximumFractionDigits() { maxCounter++ } });
assert.sameValue(1, minCounter);
assert.sameValue(1, maxCounter);