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

@ -196,7 +196,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()");
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string());
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
if (!position.has_value())
return vm.throw_completion<JS::TypeError>("Invalid cell name");
@ -225,7 +225,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");
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string());
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
if (!position.has_value())
return vm.throw_completion<JS::TypeError>("Invalid cell name");
@ -234,7 +234,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");
auto& cell = sheet_object->m_sheet.ensure(position.value());
auto& new_contents = new_contents_value.as_string().string();
auto& new_contents = new_contents_value.as_string().deprecated_string();
cell.set_data(new_contents);
return JS::js_null();
}
@ -255,7 +255,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()");
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string());
auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string());
if (!position.has_value())
return JS::js_undefined();
@ -301,7 +301,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().string();
auto& column_name_str = column_name.as_string().deprecated_string();
auto* this_object = TRY(vm.this_value().to_object(vm));
@ -326,7 +326,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().string();
auto& column_name_str = column_name.as_string().deprecated_string();
auto offset = TRY(vm.argument(1).to_number(vm));
auto offset_number = static_cast<i32>(offset.as_double());
@ -354,7 +354,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().string();
auto& column_name_str = column_name.as_string().deprecated_string();
auto* this_object = TRY(vm.this_value().to_object(vm));
if (!is<SheetGlobalObject>(this_object))
@ -405,7 +405,7 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet)
auto& workbook = static_cast<WorkbookObject*>(this_object)->m_workbook;
if (name_value.is_string()) {
auto& name = name_value.as_string().string();
auto& name = name_value.as_string().deprecated_string();
for (auto& sheet : workbook.sheets()) {
if (sheet.name() == name)
return JS::Value(&sheet.global_object());