mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibJS: Port calendar_month_code() to String
This commit is contained in:
parent
46cff34baf
commit
627291b075
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/627291b075 Pull-request: https://github.com/SerenityOS/serenity/pull/17186 Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 3 additions and 3 deletions
|
@ -230,7 +230,7 @@ ThrowCompletionOr<double> calendar_month(VM& vm, Object& calendar, Object& date_
|
|||
}
|
||||
|
||||
// 12.2.10 CalendarMonthCode ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarmonthcode
|
||||
ThrowCompletionOr<DeprecatedString> calendar_month_code(VM& vm, Object& calendar, Object& date_like)
|
||||
ThrowCompletionOr<String> calendar_month_code(VM& vm, Object& calendar, Object& date_like)
|
||||
{
|
||||
// 1. Let result be ? Invoke(calendar, "monthCode", « dateLike »).
|
||||
auto result = TRY(Value(&calendar).invoke(vm, vm.names.monthCode, &date_like));
|
||||
|
@ -240,7 +240,7 @@ ThrowCompletionOr<DeprecatedString> calendar_month_code(VM& vm, Object& calendar
|
|||
return vm.throw_completion<RangeError>(ErrorType::TemporalInvalidCalendarFunctionResult, vm.names.monthCode.as_string(), vm.names.undefined.as_string());
|
||||
|
||||
// 3. Return ? ToString(result).
|
||||
return result.to_deprecated_string(vm);
|
||||
return result.to_string(vm);
|
||||
}
|
||||
|
||||
// 12.2.11 CalendarDay ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarday
|
||||
|
|
|
@ -48,7 +48,7 @@ ThrowCompletionOr<PlainDate*> calendar_date_add(VM&, Object& calendar, Value dat
|
|||
ThrowCompletionOr<Duration*> calendar_date_until(VM&, Object& calendar, Value one, Value two, Object& options, FunctionObject* date_until = nullptr);
|
||||
ThrowCompletionOr<double> calendar_year(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<double> calendar_month(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<DeprecatedString> calendar_month_code(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<String> calendar_month_code(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<double> calendar_day(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<double> calendar_day_of_week(VM&, Object& calendar, Object& date_like);
|
||||
ThrowCompletionOr<double> calendar_day_of_year(VM&, Object& calendar, Object& date_like);
|
||||
|
|
Loading…
Reference in a new issue