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

LibJS: Use numeric style if the previous style was numeric or 2-digit

This is a normative change in the Intl.DurationFormat proposal. See:
3a46ee3
This commit is contained in:
Timothy Flynn 2022-08-30 11:42:02 -04:00 committed by Tim Flynn
parent cab1cce522
commit 127b28c940
2 changed files with 33 additions and 1 deletions

View file

@ -252,7 +252,12 @@ ThrowCompletionOr<DurationUnitOptions> get_duration_unit_options(VM& vm, String
// i. Set style to digitalBase.
style = digital_base;
}
// c. Else,
// c. Else if prevStyle is "numeric" or "2-digit", then
else if (previous_style == "numeric"sv || previous_style == "2-digit"sv) {
// i. Set style to "numeric".
style = "numeric"sv;
}
// d. Else,
else {
// i. Set style to baseStyle.
style = base_style;