diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 1e6bcb58a8..7414e0e8cc 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -243,8 +243,8 @@ ThrowCompletionOr to_temporal_offset(VM& vm, Object const* options, Stri return option.as_string().string(); } -// 13.9 ToShowCalendarOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowcalendaroption -ThrowCompletionOr to_show_calendar_option(VM& vm, Object const& normalized_options) +// 13.9 ToCalendarNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tocalendarnameoption +ThrowCompletionOr to_calendar_name_option(VM& vm, Object const& normalized_options) { // 1. Return ? GetOption(normalizedOptions, "calendarName", "string", « "auto", "always", "never", "critical" », "auto"). auto option = TRY(get_option(vm, normalized_options, vm.names.calendarName, OptionType::String, { "auto"sv, "always"sv, "never"sv, "critical"sv }, "auto"sv)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index 18066792be..a457ae6b40 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -140,7 +140,7 @@ ThrowCompletionOr to_temporal_disambiguation(VM&, Object const* options) ThrowCompletionOr to_temporal_rounding_mode(VM&, Object const& normalized_options, String const& fallback); StringView negate_temporal_rounding_mode(String const& rounding_mode); ThrowCompletionOr to_temporal_offset(VM&, Object const* options, String const& fallback); -ThrowCompletionOr to_show_calendar_option(VM&, Object const& normalized_options); +ThrowCompletionOr to_calendar_name_option(VM&, Object const& normalized_options); ThrowCompletionOr to_show_time_zone_name_option(VM&, Object const& normalized_options); ThrowCompletionOr to_show_offset_option(VM&, Object const& normalized_options); ThrowCompletionOr to_temporal_rounding_increment(VM&, Object const& normalized_options, Optional dividend, bool inclusive); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp index 2222b1eef1..d39b163a7b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp @@ -595,8 +595,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDatePrototype::to_string) // 3. Set options to ? GetOptionsObject(options). auto* options = TRY(get_options_object(vm, vm.argument(0))); - // 4. Let showCalendar be ? ToShowCalendarOption(options). - auto show_calendar = TRY(to_show_calendar_option(vm, *options)); + // 4. Let showCalendar be ? ToCalendarNameOption(options). + auto show_calendar = TRY(to_calendar_name_option(vm, *options)); // 5. Return ? TemporalDateToString(temporalDate, showCalendar). return js_string(vm, TRY(temporal_date_to_string(vm, *temporal_date, show_calendar))); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index a7cfb735e7..02e1ded641 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -600,8 +600,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::to_string) // 5. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc"). auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc"sv)); - // 6. Let showCalendar be ? ToShowCalendarOption(options). - auto show_calendar = TRY(to_show_calendar_option(vm, *options)); + // 6. Let showCalendar be ? ToCalendarNameOption(options). + auto show_calendar = TRY(to_calendar_name_option(vm, *options)); // 7. Let result be ! RoundISODateTime(dateTime.[[ISOYear]], dateTime.[[ISOMonth]], dateTime.[[ISODay]], dateTime.[[ISOHour]], dateTime.[[ISOMinute]], dateTime.[[ISOSecond]], dateTime.[[ISOMillisecond]], dateTime.[[ISOMicrosecond]], dateTime.[[ISONanosecond]], precision.[[Increment]], precision.[[Unit]], roundingMode). auto result = round_iso_date_time(date_time->iso_year(), date_time->iso_month(), date_time->iso_day(), date_time->iso_hour(), date_time->iso_minute(), date_time->iso_second(), date_time->iso_millisecond(), date_time->iso_microsecond(), date_time->iso_nanosecond(), precision.increment, precision.unit, rounding_mode); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp index 816bf4998e..7fa22e4e64 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp @@ -162,8 +162,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainMonthDayPrototype::to_string) // 3. Set options to ? GetOptionsObject(options). auto* options = TRY(get_options_object(vm, vm.argument(0))); - // 4. Let showCalendar be ? ToShowCalendarOption(options). - auto show_calendar = TRY(to_show_calendar_option(vm, *options)); + // 4. Let showCalendar be ? ToCalendarNameOption(options). + auto show_calendar = TRY(to_calendar_name_option(vm, *options)); // 5. Return ? TemporalMonthDayToString(monthDay, showCalendar). return js_string(vm, TRY(temporal_month_day_to_string(vm, *month_day, show_calendar))); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp index 9c12558557..7726e8bf99 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp @@ -329,8 +329,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainYearMonthPrototype::to_string) // 3. Set options to ? GetOptionsObject(options). auto* options = TRY(get_options_object(vm, vm.argument(0))); - // 4. Let showCalendar be ? ToShowCalendarOption(options). - auto show_calendar = TRY(to_show_calendar_option(vm, *options)); + // 4. Let showCalendar be ? ToCalendarNameOption(options). + auto show_calendar = TRY(to_calendar_name_option(vm, *options)); // 5. Return ? TemporalYearMonthToString(yearMonth, showCalendar). return js_string(vm, TRY(temporal_year_month_to_string(vm, *year_month, show_calendar))); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index bd385a2174..da133100db 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -1083,8 +1083,8 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_string) // 5. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc"). auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc")); - // 6. Let showCalendar be ? ToShowCalendarOption(options). - auto show_calendar = TRY(to_show_calendar_option(vm, *options)); + // 6. Let showCalendar be ? ToCalendarNameOption(options). + auto show_calendar = TRY(to_calendar_name_option(vm, *options)); // 7. Let showTimeZone be ? ToShowTimeZoneNameOption(options). auto show_time_zone = TRY(to_show_time_zone_name_option(vm, *options));