summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-22 19:00:49 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commitb345a0acca725d1b4e4d6df26fc602d69e97f073 (patch)
treec1a1b7936505373fc3be8cb7b6f0ced444d05d63 /Userland/Applications/Spreadsheet
parente3895e6c808d4606f02b26b1eaad3a3a803bba12 (diff)
downloadserenity-b345a0acca725d1b4e4d6df26fc602d69e97f073.zip
LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
- Prefer VM::current_realm() over GlobalObject::associated_realm() - Prefer VM::heap() over GlobalObject::heap() - Prefer Cell::vm() over Cell::global_object() - Prefer Wrapper::vm() over Wrapper::global_object() - Inline Realm::global_object() calls used to access intrinsics as they will later perform a direct lookup without going through the global object
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r--Userland/Applications/Spreadsheet/Spreadsheet.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
index da8fbc3b6e..e5da87ac9b 100644
--- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp
+++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
@@ -399,7 +399,7 @@ RefPtr<Sheet> Sheet::from_json(JsonObject const& object, Workbook& workbook)
sheet->add_column();
}
- auto json = sheet->interpreter().global_object().get_without_side_effects("JSON");
+ auto json = sheet->global_object().get_without_side_effects("JSON");
auto& parse_function = json.as_object().get_without_side_effects("parse").as_function();
auto read_format = [](auto& format, auto const& obj) {
@@ -559,7 +559,7 @@ JsonObject Sheet::to_json() const
if (it.value->kind() == Cell::Formula) {
auto& vm = interpreter().vm();
data.set("source", it.value->data());
- auto json = interpreter().global_object().get_without_side_effects("JSON");
+ auto json = interpreter().realm().global_object().get_without_side_effects("JSON");
auto stringified_or_error = JS::call(vm, json.as_object().get_without_side_effects("stringify").as_function(), json, it.value->evaluated_data());
VERIFY(!stringified_or_error.is_error());
data.set("value", stringified_or_error.release_value().to_string_without_side_effects());
@@ -702,8 +702,8 @@ JsonObject Sheet::gather_documentation() const
dbgln("Sheet::gather_documentation(): Failed to parse the documentation for '{}'!", it.key.to_display_string());
};
- for (auto& it : interpreter().global_object().shape().property_table())
- add_docs_from(it, interpreter().global_object());
+ for (auto& it : interpreter().realm().global_object().shape().property_table())
+ add_docs_from(it, interpreter().realm().global_object());
for (auto& it : global_object().shape().property_table())
add_docs_from(it, global_object());