summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-19 20:18:01 +0300
committerLinus Groh <mail@linusgroh.de>2021-10-20 12:27:19 +0100
commit20163c058485dc524402c46f21bbe65a860bf9c5 (patch)
tree35e6942b65f8138ee073efcec6dae987d9ab0377 /Userland/Applications
parent3355b52cca1e1a8478ea5dbbd193120af4c83ca6 (diff)
downloadserenity-20163c058485dc524402c46f21bbe65a860bf9c5.zip
LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.cpp14
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.h14
2 files changed, 14 insertions, 14 deletions
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp
index 463973d8e9..cf0a9f00f8 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.cpp
+++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp
@@ -169,7 +169,7 @@ void SheetGlobalObject::visit_edges(Visitor& visitor)
}
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
{
auto* this_object = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -206,7 +206,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
return JS::js_string(vm, cell->data());
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
{
auto* this_object = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -245,7 +245,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
return JS::js_null();
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
{
auto* this_object = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
@@ -276,7 +276,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
return object;
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::current_cell_position)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::current_cell_position)
{
if (vm.argument_count() != 0) {
vm.throw_exception<JS::TypeError>(global_object, "Expected no arguments to current_cell_position()");
@@ -304,7 +304,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::current_cell_position)
return object;
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_index)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::column_index)
{
if (vm.argument_count() != 1) {
vm.throw_exception<JS::TypeError>(global_object, "Expected exactly one argument to column_index()");
@@ -337,7 +337,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_index)
return JS::Value((i32)column_index.value());
}
-JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_arithmetic)
+JS_DEFINE_OLD_NATIVE_FUNCTION(SheetGlobalObject::column_arithmetic)
{
if (vm.argument_count() != 2) {
vm.throw_exception<JS::TypeError>(global_object, "Expected exactly two arguments to column_arithmetic()");
@@ -397,7 +397,7 @@ void WorkbookObject::visit_edges(Visitor& visitor)
visitor.visit(&sheet.global_object());
}
-JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet)
+JS_DEFINE_OLD_NATIVE_FUNCTION(WorkbookObject::sheet)
{
if (vm.argument_count() != 1) {
vm.throw_exception<JS::TypeError>(global_object, "Expected exactly one argument to sheet()");
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.h b/Userland/Applications/Spreadsheet/JSIntegration.h
index 8bd1e09a40..264fb7af01 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.h
+++ b/Userland/Applications/Spreadsheet/JSIntegration.h
@@ -32,12 +32,12 @@ public:
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyName const&, JS::Value value, JS::Value receiver) override;
virtual void initialize_global_object() override;
- JS_DECLARE_NATIVE_FUNCTION(get_real_cell_contents);
- JS_DECLARE_NATIVE_FUNCTION(set_real_cell_contents);
- JS_DECLARE_NATIVE_FUNCTION(parse_cell_name);
- JS_DECLARE_NATIVE_FUNCTION(current_cell_position);
- JS_DECLARE_NATIVE_FUNCTION(column_index);
- JS_DECLARE_NATIVE_FUNCTION(column_arithmetic);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(get_real_cell_contents);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(set_real_cell_contents);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(parse_cell_name);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(current_cell_position);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(column_index);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(column_arithmetic);
private:
virtual void visit_edges(Visitor&) override;
@@ -54,7 +54,7 @@ public:
virtual void initialize(JS::GlobalObject&) override;
- JS_DECLARE_NATIVE_FUNCTION(sheet);
+ JS_DECLARE_OLD_NATIVE_FUNCTION(sheet);
private:
virtual void visit_edges(Visitor&) override;