mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:57:34 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -174,7 +174,7 @@ ThrowCompletionOr<PlainMonthDay*> create_temporal_month_day(VM& vm, u8 iso_month
|
|||
}
|
||||
|
||||
// 10.5.3 TemporalMonthDayToString ( monthDay, showCalendar ), https://tc39.es/proposal-temporal/#sec-temporal-temporalmonthdaytostring
|
||||
ThrowCompletionOr<String> temporal_month_day_to_string(VM& vm, PlainMonthDay& month_day, StringView show_calendar)
|
||||
ThrowCompletionOr<DeprecatedString> temporal_month_day_to_string(VM& vm, PlainMonthDay& month_day, StringView show_calendar)
|
||||
{
|
||||
// 1. Assert: Type(monthDay) is Object.
|
||||
// 2. Assert: monthDay has an [[InitializedTemporalMonthDay]] internal slot.
|
||||
|
@ -182,7 +182,7 @@ ThrowCompletionOr<String> temporal_month_day_to_string(VM& vm, PlainMonthDay& mo
|
|||
// 3. Let month be ToZeroPaddedDecimalString(temporalDate.[[ISOMonth]], 2).
|
||||
// 4. Let day be ToZeroPaddedDecimalString(temporalDate.[[ISODay]], 2).
|
||||
// 5. Let result be the string-concatenation of month, the code unit 0x002D (HYPHEN-MINUS), and day.
|
||||
auto result = String::formatted("{:02}-{:02}", month_day.iso_month(), month_day.iso_day());
|
||||
auto result = DeprecatedString::formatted("{:02}-{:02}", month_day.iso_month(), month_day.iso_day());
|
||||
|
||||
// 6. Let calendarID be ? ToString(monthDay.[[Calendar]]).
|
||||
auto calendar_id = TRY(Value(&month_day.calendar()).to_string(vm));
|
||||
|
@ -191,7 +191,7 @@ ThrowCompletionOr<String> temporal_month_day_to_string(VM& vm, PlainMonthDay& mo
|
|||
if (show_calendar.is_one_of("always"sv, "critical"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);
|
||||
result = DeprecatedString::formatted("{}-{}", pad_iso_year(month_day.iso_year()), result);
|
||||
}
|
||||
|
||||
// 8. Let calendarString be ! FormatCalendarAnnotation(calendarID, showCalendar).
|
||||
|
@ -199,7 +199,7 @@ ThrowCompletionOr<String> temporal_month_day_to_string(VM& vm, PlainMonthDay& mo
|
|||
|
||||
// 9. Set result to the string-concatenation of result and calendarString.
|
||||
// 10. Return result.
|
||||
return String::formatted("{}{}", result, calendar_string);
|
||||
return DeprecatedString::formatted("{}{}", result, calendar_string);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue