summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/JSIntegration.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-22 11:48:08 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commitb465f46e009164b5d2659f216b9307efee187222 (patch)
tree33038f3bc2c9d2d7e29c67bdfa94f38b2f761013 /Userland/Applications/Spreadsheet/JSIntegration.cpp
parent7b990c27a14eddd152932d8540afc8c3838030fb (diff)
downloadserenity-b465f46e009164b5d2659f216b9307efee187222.zip
LibJS: Remove GlobalObject parameter from native functions
Diffstat (limited to 'Userland/Applications/Spreadsheet/JSIntegration.cpp')
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp
index dabd7e50c4..601ae8fcef 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.cpp
+++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp
@@ -177,7 +177,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_name)
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "SheetGlobalObject");
auto sheet_object = static_cast<SheetGlobalObject*>(this_object);
- return JS::js_string(global_object.heap(), sheet_object->m_sheet.name());
+ return JS::js_string(vm, sheet_object->m_sheet.name());
}
JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
@@ -240,7 +240,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents)
JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
{
- auto& realm = *global_object.associated_realm();
+ auto& realm = *vm.current_realm();
auto* this_object = TRY(vm.this_value().to_object(vm));
@@ -258,7 +258,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
if (!position.has_value())
return JS::js_undefined();
- auto object = JS::Object::create(realm, global_object.object_prototype());
+ auto object = JS::Object::create(realm, realm.global_object().object_prototype());
object->define_direct_property("column", JS::js_string(vm, sheet_object->m_sheet.column(position.value().column)), JS::default_attributes);
object->define_direct_property("row", JS::Value((unsigned)position.value().row), JS::default_attributes);
@@ -267,7 +267,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name)
JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::current_cell_position)
{
- auto& realm = *global_object.associated_realm();
+ auto& realm = *vm.current_realm();
if (vm.argument_count() != 0)
return vm.throw_completion<JS::TypeError>("Expected no arguments to current_cell_position()");
@@ -284,7 +284,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::current_cell_position)
auto position = current_cell->position();
- auto object = JS::Object::create(realm, global_object.object_prototype());
+ auto object = JS::Object::create(realm, realm.global_object().object_prototype());
object->define_direct_property("column", JS::js_string(vm, sheet_object->m_sheet.column(position.column)), JS::default_attributes);
object->define_direct_property("row", JS::Value((unsigned)position.row), JS::default_attributes);