1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +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

@ -197,7 +197,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
auto name_value = vm.argument(0);
if (!name_value.is_string())
return vm.throw_completion<JS::TypeError>("Expected a String argument to get_real_cell_contents()"sv);
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().byte_string());
if (!position.has_value())
return vm.throw_completion<JS::TypeError>("Invalid cell name"sv);
@ -206,7 +206,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
return JS::js_undefined();
if (cell->kind() == Spreadsheet::Cell::Kind::Formula)
return JS::PrimitiveString::create(vm, DeprecatedString::formatted("={}", cell->data()));
return JS::PrimitiveString::create(vm, ByteString::formatted("={}", cell->data()));
return JS::PrimitiveString::create(vm, cell->data());
}
@ -226,7 +226,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
auto name_value = vm.argument(0);
if (!name_value.is_string())
return vm.throw_completion<JS::TypeError>("Expected the first argument of set_real_cell_contents() to be a String"sv);
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().byte_string());
if (!position.has_value())
return vm.throw_completion<JS::TypeError>("Invalid cell name"sv);
@ -235,7 +235,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
return vm.throw_completion<JS::TypeError>("Expected the second argument of set_real_cell_contents() to be a String"sv);
auto& cell = sheet_object.m_sheet.ensure(position.value());
auto new_contents = new_contents_value.as_string().deprecated_string();
auto new_contents = new_contents_value.as_string().byte_string();
cell.set_data(new_contents);
return JS::js_null();
}
@ -256,7 +256,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
auto name_value = vm.argument(0);
if (!name_value.is_string())
return vm.throw_completion<JS::TypeError>("Expected a String argument to parse_cell_name()"sv);
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
auto position = sheet_object.m_sheet.parse_cell_name(name_value.as_string().byte_string());
if (!position.has_value())
return JS::js_undefined();
@ -302,7 +302,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_index)
if (!column_name.is_string())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "String");
auto column_name_str = column_name.as_string().deprecated_string();
auto column_name_str = column_name.as_string().byte_string();
auto this_object = TRY(vm.this_value().to_object(vm));
@ -327,7 +327,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_arithmetic)
if (!column_name.is_string())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "String");
auto column_name_str = column_name.as_string().deprecated_string();
auto column_name_str = column_name.as_string().byte_string();
auto offset = TRY(vm.argument(1).to_number(vm));
auto offset_number = static_cast<i32>(offset.as_double());
@ -355,7 +355,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_column_bound)
if (!column_name.is_string())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "String");
auto column_name_str = column_name.as_string().deprecated_string();
auto column_name_str = column_name.as_string().byte_string();
auto this_object = TRY(vm.this_value().to_object(vm));
if (!is<SheetGlobalObject>(*this_object))
@ -407,7 +407,7 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet)
auto& workbook = workbook_object.m_workbook;
if (name_value.is_string()) {
auto name = name_value.as_string().deprecated_string();
auto name = name_value.as_string().byte_string();
for (auto& sheet : workbook.sheets()) {
if (sheet->name() == name)
return JS::Value(&sheet->global_object());