5efc4d0b74
Design Doc: https://goo.gl/ZAtL1f Bug: v8:8515 Change-Id: I543ab704fd3f8b41e396879ebbc581977ec0ff10 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612325 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#61709}
71 lines
1.7 KiB
JavaScript
71 lines
1.7 KiB
JavaScript
// Copyright 2019 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --harmony-intl-numberformat-unified
|
|
// Similar to constructor-order.js but also consider the new options
|
|
// in https://tc39-transfer.github.io/proposal-unified-intl-numberformat/
|
|
|
|
// Throws only once during construction.
|
|
// Check for all getters to prevent regression.
|
|
// Preserve the order of getter initialization.
|
|
let getCount = 0;
|
|
|
|
new Intl.NumberFormat(['en-US'], {
|
|
get localeMatcher() {
|
|
assertEquals(0, getCount++);
|
|
},
|
|
get style() {
|
|
assertEquals(1, getCount++);
|
|
},
|
|
get currency() {
|
|
assertEquals(2, getCount++);
|
|
},
|
|
get currencyDisplay() {
|
|
assertEquals(3, getCount++);
|
|
},
|
|
// Begin of new options
|
|
get currencySign() {
|
|
assertEquals(4, getCount++);
|
|
},
|
|
get unit() {
|
|
assertEquals(5, getCount++);
|
|
},
|
|
get unitDisplay() {
|
|
assertEquals(6, getCount++);
|
|
},
|
|
// End of new options
|
|
get minimumIntegerDigits() {
|
|
assertEquals(7, getCount++);
|
|
},
|
|
get minimumFractionDigits() {
|
|
assertEquals(8, getCount++);
|
|
},
|
|
get maximumFractionDigits() {
|
|
assertEquals(9, getCount++);
|
|
},
|
|
get minimumSignificantDigits() {
|
|
assertEquals(10, getCount++);
|
|
},
|
|
get maximumSignificantDigits() {
|
|
assertEquals(11, getCount++);
|
|
},
|
|
// Begin of new options
|
|
get notation() {
|
|
assertEquals(12, getCount++);
|
|
},
|
|
get compactDisplay() {
|
|
assertEquals(13, getCount++);
|
|
},
|
|
// End of new options
|
|
get useGrouping() {
|
|
assertEquals(14, getCount++);
|
|
},
|
|
// Begin of new options
|
|
get signDisplay() {
|
|
assertEquals(15, getCount++);
|
|
},
|
|
// End of new options
|
|
});
|
|
assertEquals(16, getCount);
|