1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:17:44 +00:00

LibJS+Everywhere: Rename Value::to_string to to_deprecated_string

This commit is contained in:
Timothy Flynn 2023-01-13 10:29:02 -05:00 committed by Linus Groh
parent 8f5bdce8e7
commit afeb7273cc
68 changed files with 193 additions and 193 deletions

View file

@ -240,7 +240,7 @@ ThrowCompletionOr<Vector<DeprecatedString>> canonicalize_locale_list(VM& vm, Val
// iv. Else,
else {
// 1. Let tag be ? ToString(kValue).
tag = TRY(key_value.to_string(vm));
tag = TRY(key_value.to_deprecated_string(vm));
}
// v. If ! IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.
@ -628,7 +628,7 @@ ThrowCompletionOr<StringOrBoolean> get_string_or_boolean_option(VM& vm, Object c
return falsy_value;
// 6. Let value be ? ToString(value).
auto value_string = TRY(value.to_string(vm));
auto value_string = TRY(value.to_deprecated_string(vm));
// 7. NOTE: For historical reasons, the strings "true" and "false" are treated the same as the boolean value true.
// 8. If value is "true" or "false", return fallback.

View file

@ -58,9 +58,9 @@ ThrowCompletionOr<Value> CollatorCompareFunction::call()
// 4. If y is not provided, let y be undefined.
// 5. Let X be ? ToString(x).
auto x = TRY(vm.argument(0).to_string(vm));
auto x = TRY(vm.argument(0).to_deprecated_string(vm));
// 6. Let Y be ? ToString(y).
auto y = TRY(vm.argument(1).to_string(vm));
auto y = TRY(vm.argument(1).to_deprecated_string(vm));
// 7. Return CompareStrings(collator, X, Y).
return compare_strings(m_collator, Utf8View(x), Utf8View(y));

View file

@ -63,7 +63,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
// a. Let numeric be ! ToString(numeric).
// 15. Set opt.[[kn]] to numeric.
if (!numeric.is_undefined())
opt.kn = MUST(numeric.to_string(vm));
opt.kn = MUST(numeric.to_deprecated_string(vm));
// 16. Let caseFirst be ? GetOption(options, "caseFirst", string, « "upper", "lower", "false" », undefined).
// 17. Set opt.[[kf]] to caseFirst.

View file

@ -224,7 +224,7 @@ ThrowCompletionOr<DateTimeFormat*> initialize_date_time_format(VM& vm, DateTimeF
// 31. Else,
else {
// a. Set timeZone to ? ToString(timeZone).
time_zone = TRY(time_zone_value.to_string(vm));
time_zone = TRY(time_zone_value.to_deprecated_string(vm));
// b. If IsAvailableTimeZoneName(timeZone) is false, then
if (!Temporal::is_available_time_zone_name(time_zone)) {

View file

@ -43,7 +43,7 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::of)
auto* display_names = TRY(typed_this_object(vm));
// 3. Let code be ? ToString(code).
auto code_string = TRY(code.to_string(vm));
auto code_string = TRY(code.to_deprecated_string(vm));
code = PrimitiveString::create(vm, move(code_string));
// 4. Let code be ? CanonicalCodeForDisplayNames(displayNames.[[Type]], code).

View file

@ -111,7 +111,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::supported_values_of)
auto& realm = *vm.current_realm();
// 1. Let key be ? ToString(key).
auto key = TRY(vm.argument(0).to_string(vm));
auto key = TRY(vm.argument(0).to_deprecated_string(vm));
Span<StringView const> list;

View file

@ -275,7 +275,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> LocaleConstructor::construct(FunctionObj
// 9. Else,
else {
// a. Let tag be ? ToString(tag).
tag = TRY(tag_value.to_string(vm));
tag = TRY(tag_value.to_deprecated_string(vm));
}
// 10. Set options to ? CoerceOptionsToObject(options).
@ -313,7 +313,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> LocaleConstructor::construct(FunctionObj
// 24. If kn is not undefined, set kn to ! ToString(kn).
// 25. Set opt.[[kn]] to kn.
if (!kn.is_undefined())
opt.kn = TRY(kn.to_string(vm));
opt.kn = TRY(kn.to_deprecated_string(vm));
// 26. Let numberingSystem be ? GetOption(options, "numberingSystem", string, empty, undefined).
// 27. If numberingSystem is not undefined, then

View file

@ -141,7 +141,7 @@ ThrowCompletionOr<Vector<PatternPartitionWithUnit>> partition_relative_time_patt
// 16. If numeric is equal to "auto", then
if (relative_time_format.numeric() == RelativeTimeFormat::Numeric::Auto) {
// a. Let valueString be ToString(value).
auto value_string = MUST(Value(value).to_string(vm));
auto value_string = MUST(Value(value).to_deprecated_string(vm));
// b. If patterns has a field [[<valueString>]], then
if (auto patterns = find_patterns_for_tense_or_number(value_string); !patterns.is_empty()) {

View file

@ -42,7 +42,7 @@ JS_DEFINE_NATIVE_FUNCTION(RelativeTimeFormatPrototype::format)
auto value = TRY(vm.argument(0).to_number(vm));
// 4. Let unit be ? ToString(unit).
auto unit = TRY(vm.argument(1).to_string(vm));
auto unit = TRY(vm.argument(1).to_deprecated_string(vm));
// 5. Return ? FormatRelativeTime(relativeTimeFormat, value, unit).
auto formatted = TRY(format_relative_time(vm, *relative_time_format, value.as_double(), unit));
@ -60,7 +60,7 @@ JS_DEFINE_NATIVE_FUNCTION(RelativeTimeFormatPrototype::format_to_parts)
auto value = TRY(vm.argument(0).to_number(vm));
// 4. Let unit be ? ToString(unit).
auto unit = TRY(vm.argument(1).to_string(vm));
auto unit = TRY(vm.argument(1).to_deprecated_string(vm));
// 5. Return ? FormatRelativeTimeToParts(relativeTimeFormat, value, unit).
return TRY(format_relative_time_to_parts(vm, *relative_time_format, value.as_double(), unit));