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

LibJS: Emit reference information for { calendarName: "always" } option

This is a normative change in the Temporal spec.

See: 4f7519a
This commit is contained in:
Linus Groh 2022-03-30 17:56:30 +01:00
parent 29aa938fa5
commit b5392f9e39
4 changed files with 8 additions and 6 deletions

View file

@ -187,8 +187,8 @@ ThrowCompletionOr<String> temporal_month_day_to_string(GlobalObject& global_obje
// 6. Let calendarID be ? ToString(monthDay.[[Calendar]]).
auto calendar_id = TRY(Value(&month_day.calendar()).to_string(global_object));
// 7. If calendarID is not "iso8601", then
if (calendar_id != "iso8601"sv) {
// 7. If showCalendar is "always" or if calendarID is not "iso8601", then
if (show_calendar == "always"sv || calendar_id != "iso8601"sv) {
// a. Let year be ! PadISOYear(monthDay.[[ISOYear]]).
// b. Set result to the string-concatenation of year, the code unit 0x002D (HYPHEN-MINUS), and result.
result = String::formatted("{}-{}", pad_iso_year(month_day.iso_year()), result);