1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:57:35 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -527,7 +527,7 @@ ThrowCompletionOr<Optional<String>> get_temporal_unit(VM& vm, Object const& norm
// 10. If value is undefined and default is required, throw a RangeError exception.
if (option_value.is_undefined() && default_.has<TemporalUnitRequired>())
return vm.throw_completion<RangeError>(ErrorType::IsUndefined, DeprecatedString::formatted("{} option value", key.as_string()));
return vm.throw_completion<RangeError>(ErrorType::IsUndefined, ByteString::formatted("{} option value", key.as_string()));
auto value = option_value.is_undefined()
? Optional<String> {}
@ -1794,7 +1794,7 @@ ThrowCompletionOr<Object*> prepare_temporal_fields(VM& vm, Object const& fields,
// 3. For each value property of fieldNames, do
for (auto& property : field_names) {
// a. Let value be ? Get(fields, property).
auto value = TRY(fields.get(property.to_deprecated_string()));
auto value = TRY(fields.get(property.to_byte_string()));
// b. If value is not undefined, then
if (!value.is_undefined()) {
@ -1823,7 +1823,7 @@ ThrowCompletionOr<Object*> prepare_temporal_fields(VM& vm, Object const& fields,
}
// iii. Perform ! CreateDataPropertyOrThrow(result, property, value).
MUST(result->create_data_property_or_throw(property.to_deprecated_string(), value));
MUST(result->create_data_property_or_throw(property.to_byte_string(), value));
}
// c. Else if requiredFields is a List, then
else if (required_fields.has<Vector<StringView>>()) {
@ -1840,7 +1840,7 @@ ThrowCompletionOr<Object*> prepare_temporal_fields(VM& vm, Object const& fields,
}
// iii. Perform ! CreateDataPropertyOrThrow(result, property, value).
MUST(result->create_data_property_or_throw(property.to_deprecated_string(), value));
MUST(result->create_data_property_or_throw(property.to_byte_string(), value));
}
}

View file

@ -787,7 +787,7 @@ ThrowCompletionOr<double> resolve_iso_month(VM& vm, Object const& fields)
// 6. Assert: Type(monthCode) is String.
VERIFY(month_code.is_string());
auto month_code_string = month_code.as_string().deprecated_string();
auto month_code_string = month_code.as_string().byte_string();
// 7. If the length of monthCode is not 3, throw a RangeError exception.
auto month_length = month_code_string.length();
@ -963,7 +963,7 @@ ThrowCompletionOr<Object*> default_merge_calendar_fields(VM& vm, Object const& f
// 3. For each element key of fieldsKeys, do
for (auto& key : fields_keys) {
// a. If key is not "month" or "monthCode", then
if (!key.as_string().deprecated_string().is_one_of(vm.names.month.as_string(), vm.names.monthCode.as_string())) {
if (!key.as_string().byte_string().is_one_of(vm.names.month.as_string(), vm.names.monthCode.as_string())) {
auto property_key = MUST(PropertyKey::from_value(vm, key));
// i. Let propValue be ? Get(fields, key).
@ -997,7 +997,7 @@ ThrowCompletionOr<Object*> default_merge_calendar_fields(VM& vm, Object const& f
}
// See comment above.
additional_fields_keys_contains_month_or_month_code_property |= key.as_string().deprecated_string() == vm.names.month.as_string() || key.as_string().deprecated_string() == vm.names.monthCode.as_string();
additional_fields_keys_contains_month_or_month_code_property |= key.as_string().byte_string() == vm.names.month.as_string() || key.as_string().byte_string() == vm.names.monthCode.as_string();
}
// 6. If additionalFieldsKeys does not contain either "month" or "monthCode", then