1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +00:00

LibJS: Raise the upper minimum/maximum fraction digit limit to 100

This is a normative change in the ECMA-402 spec. See:
f6d2945
This commit is contained in:
Timothy Flynn 2023-07-21 20:49:29 -04:00 committed by Linus Groh
parent 3fdf5072ec
commit ea774111e8
3 changed files with 24 additions and 24 deletions

View file

@ -324,11 +324,11 @@ ThrowCompletionOr<void> set_number_format_digit_options(VM& vm, NumberFormatBase
if (need_fraction_digits) {
// a. If hasFd is true, then
if (has_fraction_digits) {
// i. Set mnfd to ? DefaultNumberOption(mnfd, 0, 20, undefined).
auto min_digits = TRY(default_number_option(vm, min_fraction_digits, 0, 20, {}));
// i. Set mnfd to ? DefaultNumberOption(mnfd, 0, 100, undefined).
auto min_digits = TRY(default_number_option(vm, min_fraction_digits, 0, 100, {}));
// ii. Set mxfd to ? DefaultNumberOption(mxfd, 0, 20, undefined).
auto max_digits = TRY(default_number_option(vm, max_fraction_digits, 0, 20, {}));
// ii. Set mxfd to ? DefaultNumberOption(mxfd, 0, 100, undefined).
auto max_digits = TRY(default_number_option(vm, max_fraction_digits, 0, 100, {}));
// iii. If mnfd is undefined, set mnfd to min(mnfdDefault, mxfd).
if (!min_digits.has_value())