1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -27,7 +27,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
auto usage = TRY(get_option(vm, *options, vm.names.usage, OptionType::String, { "sort"sv, "search"sv }, "sort"sv));
// 4. Set collator.[[Usage]] to usage.
collator.set_usage(usage.as_string().string());
collator.set_usage(usage.as_string().deprecated_string());
// 5. If usage is "sort", then
// a. Let localeData be %Collator%.[[SortLocaleData]].
@ -49,11 +49,11 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
// 11. If collation is not undefined, then
if (!collation.is_undefined()) {
// a. If collation does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
if (!::Locale::is_type_identifier(collation.as_string().string()))
if (!::Locale::is_type_identifier(collation.as_string().deprecated_string()))
return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, collation, "collation"sv);
// 12. Set opt.[[co]] to collation.
opt.co = collation.as_string().string();
opt.co = collation.as_string().deprecated_string();
}
// 13. Let numeric be ? GetOption(options, "numeric", "boolean", undefined, undefined).
@ -69,7 +69,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
// 17. Set opt.[[kf]] to caseFirst.
auto case_first = TRY(get_option(vm, *options, vm.names.caseFirst, OptionType::String, { "upper"sv, "lower"sv, "false"sv }, Empty {}));
if (!case_first.is_undefined())
opt.kf = case_first.as_string().string();
opt.kf = case_first.as_string().deprecated_string();
// 18. Let relevantExtensionKeys be %Collator%.[[RelevantExtensionKeys]].
auto relevant_extension_keys = Collator::relevant_extension_keys();
@ -117,7 +117,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
}
// 28. Set collator.[[Sensitivity]] to sensitivity.
collator.set_sensitivity(sensitivity.as_string().string());
collator.set_sensitivity(sensitivity.as_string().deprecated_string());
// 29. Let ignorePunctuation be ? GetOption(options, "ignorePunctuation", "boolean", undefined, false).
auto ignore_punctuation = TRY(get_option(vm, *options, vm.names.ignorePunctuation, OptionType::Boolean, {}, false));