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

LibJS: Update spec comments to use ToZeroPaddedDecimalString AO

This is an editorial change in the ECMA-262 and Temporal specs.

See:
- 843d8b8
- f9211d9

Note that we don't actually need to implement the AO as we already have
String::formatted() for this, and use unified format strings instead of
zero-padding in individual steps in many cases anyway.
This commit is contained in:
Linus Groh 2022-04-12 22:20:33 +01:00
parent 431a9938a8
commit 5397278bfc
10 changed files with 41 additions and 45 deletions

View file

@ -275,10 +275,10 @@ ThrowCompletionOr<String> temporal_date_time_to_string(GlobalObject& global_obje
// 1. Assert: isoYear, isoMonth, isoDay, hour, minute, second, millisecond, microsecond, and nanosecond are integers.
// 2. Let year be ! PadISOYear(isoYear).
// 3. Let month be isoMonth formatted as a two-digit decimal number, padded to the left with a zero if necessary.
// 4. Let day be isoDay formatted as a two-digit decimal number, padded to the left with a zero if necessary.
// 5. Let hour be hour formatted as a two-digit decimal number, padded to the left with a zero if necessary.
// 6. Let minute be minute formatted as a two-digit decimal number, padded to the left with a zero if necessary.
// 3. Let month be ToZeroPaddedDecimalString(isoMonth, 2).
// 4. Let day be ToZeroPaddedDecimalString(isoDay, 2).
// 5. Let hour be ToZeroPaddedDecimalString(hour, 2).
// 6. Let minute be ToZeroPaddedDecimalString(minute, 2).
// 7. Let seconds be ! FormatSecondsStringPart(second, millisecond, microsecond, nanosecond, precision).
auto seconds = format_seconds_string_part(second, millisecond, microsecond, nanosecond, precision);