Bug 1855747: Raise fractional digits limit to 100. r=dminor

Implements the changes from <https://github.com/tc39/ecma402/pull/786>.

Drive-by change:
Enable another test which no longer fails.

Differential Revision: https://phabricator.services.mozilla.com/D189541
This commit is contained in:
André Bargull 2023-11-05 12:27:03 +00:00
parent 99b98c11e9
commit c9f06ab4c4
4 changed files with 7 additions and 15 deletions

View File

@ -315,8 +315,7 @@ bool NumberFormatterSkeleton::roundingIncrement(uint32_t increment,
MOZ_ASSERT(mnfd <= mxfd);
MOZ_ASSERT(increment > 1);
// Limit |mxfd| to 100. (20 is the current limit for ECMA-402, but there are
// plans to change it to 100.)
// Limit |mxfd| to 100.
constexpr size_t maxFracDigits = 100;
MOZ_RELEASE_ASSERT(mxfd <= maxFracDigits);

View File

@ -343,10 +343,10 @@ function SetNumberFormatDigitOptions(
// Step 25.a.
if (hasFractionDigits) {
// Step 25.a.i.
mnfd = DefaultNumberOption(mnfd, 0, 20, undefined);
mnfd = DefaultNumberOption(mnfd, 0, 100, undefined);
// Step 25.a.ii.
mxfd = DefaultNumberOption(mxfd, 0, 20, undefined);
mxfd = DefaultNumberOption(mxfd, 0, 100, undefined);
// Step 25.a.iii.
if (mnfd === undefined) {
@ -626,8 +626,8 @@ function InitializeNumberFormat(numberFormat, thisValue, locales, options) {
// minimumIntegerDigits: integer ∈ [1, 21],
//
// // optional, mutually exclusive with the significant-digits option
// minimumFractionDigits: integer ∈ [0, 20],
// maximumFractionDigits: integer ∈ [0, 20],
// minimumFractionDigits: integer ∈ [0, 100],
// maximumFractionDigits: integer ∈ [0, 100],
//
// // optional, mutually exclusive with the fraction-digits option
// minimumSignificantDigits: integer ∈ [1, 21],

View File

@ -159,8 +159,8 @@ function InitializePluralRules(pluralRules, locales, options) {
// minimumIntegerDigits: integer ∈ [1, 21],
//
// // optional, mutually exclusive with the significant-digits option
// minimumFractionDigits: integer ∈ [0, 20],
// maximumFractionDigits: integer ∈ [0, 20],
// minimumFractionDigits: integer ∈ [0, 100],
// maximumFractionDigits: integer ∈ [0, 100],
//
// // optional, mutually exclusive with the fraction-digits option
// minimumSignificantDigits: integer ∈ [1, 21],

View File

@ -609,13 +609,6 @@ skip script test262/built-ins/AsyncGeneratorPrototype/return/return-state-comple
skip script test262/built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-broken-promise.js
skip script test262/built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-broken-promise-try-catch.js
# https://github.com/tc39/proposal-intl-numberformat-v3/pull/107
skip script test262/intl402/NumberFormat/test-option-useGrouping.js
# https://github.com/tc39/test262/pull/3875
skip script test262/intl402/NumberFormat/throws-for-maximumFractionDigits-over-limit.js
skip script test262/intl402/NumberFormat/throws-for-minimumFractionDigits-over-limit.js
# Requires Unicode 15.1
skip script test262/built-ins/RegExp/unicodeSets/generated/rgi-emoji-15.1.js