summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/NumberFormat/constructor-signDisplay-negative.js
blob: 32ad4023c7bfc7417a9bc48550793eb26cfcf854 (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
// Copyright 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializenumberformat
description: Checks handling of the compactDisplay option to the NumberFormat constructor.
info: |
  InitializeNumberFormat ( numberFormat, locales, options )

  32. Let signDisplay be ? GetOption(options, "signDisplay", "string", « "auto", "never", "always", "exceptZero", "negative" », "auto").
  33. Set numberFormat.[[SignDisplay]] to signDisplay.
includes: [propertyHelper.js]
features: [Intl.NumberFormat-v3]
---*/

const nf = new Intl.NumberFormat([], {
  signDisplay: 'negative',
});
const resolvedOptions = nf.resolvedOptions();

verifyProperty(resolvedOptions, 'signDisplay', {
  value: 'negative',
  writable: true,
  enumerable: true,
  configurable: true
});

reportCompare(0, 0);