diff options
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 8d3aec199b..54795ef036 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -414,7 +414,7 @@ ThrowCompletionOr<String> pad_iso_year(VM& vm, i32 y) } // 3.5.8 TemporalDateToString ( temporalDate, showCalendar ), https://tc39.es/proposal-temporal/#sec-temporal-temporaldatetostring -ThrowCompletionOr<DeprecatedString> temporal_date_to_string(VM& vm, PlainDate& temporal_date, StringView show_calendar) +ThrowCompletionOr<String> temporal_date_to_string(VM& vm, PlainDate& temporal_date, StringView show_calendar) { // 1. Assert: Type(temporalDate) is Object. // 2. Assert: temporalDate has an [[InitializedTemporalDate]] internal slot. @@ -423,16 +423,16 @@ ThrowCompletionOr<DeprecatedString> temporal_date_to_string(VM& vm, PlainDate& t auto year = MUST_OR_THROW_OOM(pad_iso_year(vm, temporal_date.iso_year())); // 4. Let month be ToZeroPaddedDecimalString(monthDay.[[ISOMonth]], 2). - auto month = DeprecatedString::formatted("{:02}", temporal_date.iso_month()); + auto month = TRY_OR_THROW_OOM(vm, String::formatted("{:02}", temporal_date.iso_month())); // 5. Let day be ToZeroPaddedDecimalString(monthDay.[[ISODay]], 2). - auto day = DeprecatedString::formatted("{:02}", temporal_date.iso_day()); + auto day = TRY_OR_THROW_OOM(vm, String::formatted("{:02}", temporal_date.iso_day())); // 6. Let calendar be ? MaybeFormatCalendarAnnotation(temporalDate.[[Calendar]], showCalendar). auto calendar = TRY(maybe_format_calendar_annotation(vm, &temporal_date.calendar(), show_calendar)); // 7. Return the string-concatenation of year, the code unit 0x002D (HYPHEN-MINUS), month, the code unit 0x002D (HYPHEN-MINUS), day, and calendar. - return DeprecatedString::formatted("{}-{}-{}{}", year, month, day, calendar); + return TRY_OR_THROW_OOM(vm, String::formatted("{}-{}-{}{}", year, month, day, calendar)); } // 3.5.9 AddISODate ( year, month, day, years, months, weeks, days, overflow ), https://tc39.es/proposal-temporal/#sec-temporal-addisodate diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h index 1a30e6d48e..48053c72bf 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h @@ -53,7 +53,7 @@ ThrowCompletionOr<ISODateRecord> regulate_iso_date(VM&, double year, double mont bool is_valid_iso_date(i32 year, u8 month, u8 day); ISODateRecord balance_iso_date(double year, double month, double day); ThrowCompletionOr<String> pad_iso_year(VM&, i32 y); -ThrowCompletionOr<DeprecatedString> temporal_date_to_string(VM&, PlainDate&, StringView show_calendar); +ThrowCompletionOr<String> temporal_date_to_string(VM&, PlainDate&, StringView show_calendar); ThrowCompletionOr<ISODateRecord> add_iso_date(VM&, i32 year, u8 month, u8 day, double years, double months, double weeks, double days, StringView overflow); i8 compare_iso_date(i32 year1, u8 month1, u8 day1, i32 year2, u8 month2, u8 day2); ThrowCompletionOr<Duration*> difference_temporal_plain_date(VM&, DifferenceOperation, PlainDate&, Value other, Value options); |