summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-22 21:47:35 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commite3895e6c808d4606f02b26b1eaad3a3a803bba12 (patch)
treee3fe097d28b10f984df6cd67ca987a743cede389 /Userland/Applications/Spreadsheet
parent7c468b5a772342243d1b306389c34ce485033392 (diff)
downloadserenity-e3895e6c808d4606f02b26b1eaad3a3a803bba12.zip
LibJS: Pass Realm to define_native_{accessor,function}()
This is needed so that the allocated NativeFunction receives the correct realm, usually forwarded from the Object's initialize() function, rather than using the current realm.
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp
index 10b5d3d420..cbc4369780 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.cpp
+++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp
@@ -148,14 +148,14 @@ void SheetGlobalObject::initialize_global_object(JS::Realm& realm)
{
Base::initialize_global_object(realm);
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
- define_native_function("get_real_cell_contents", get_real_cell_contents, 1, attr);
- define_native_function("set_real_cell_contents", set_real_cell_contents, 2, attr);
- define_native_function("parse_cell_name", parse_cell_name, 1, attr);
- define_native_function("current_cell_position", current_cell_position, 0, attr);
- define_native_function("column_arithmetic", column_arithmetic, 2, attr);
- define_native_function("column_index", column_index, 1, attr);
- define_native_function("get_column_bound", get_column_bound, 1, attr);
- define_native_accessor("name", get_name, nullptr, attr);
+ define_native_function(realm, "get_real_cell_contents", get_real_cell_contents, 1, attr);
+ define_native_function(realm, "set_real_cell_contents", set_real_cell_contents, 2, attr);
+ define_native_function(realm, "parse_cell_name", parse_cell_name, 1, attr);
+ define_native_function(realm, "current_cell_position", current_cell_position, 0, attr);
+ define_native_function(realm, "column_arithmetic", column_arithmetic, 2, attr);
+ define_native_function(realm, "column_index", column_index, 1, attr);
+ define_native_function(realm, "get_column_bound", get_column_bound, 1, attr);
+ define_native_accessor(realm, "name", get_name, nullptr, attr);
}
void SheetGlobalObject::visit_edges(Visitor& visitor)
@@ -378,7 +378,7 @@ WorkbookObject::WorkbookObject(JS::Realm& realm, Workbook& workbook)
void WorkbookObject::initialize(JS::Realm& realm)
{
Object::initialize(realm);
- define_native_function("sheet", sheet, 1, JS::default_attributes);
+ define_native_function(realm, "sheet", sheet, 1, JS::default_attributes);
}
void WorkbookObject::visit_edges(Visitor& visitor)