summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-21 14:00:56 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commita022e548b808df91c471cb55f0245e15957e89c4 (patch)
treed6a7d452eae1d06e537a2fd77348ecaab278614f /Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
parentf6c4a0f5d00a6a03a5165f1618516acb320f13a4 (diff)
downloadserenity-a022e548b808df91c471cb55f0245e15957e89c4.zip
LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
This is where the fun begins. :^)
Diffstat (limited to 'Userland/Applications/Spreadsheet/SpreadsheetModel.cpp')
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetModel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
index dfa11afd00..dd45c10988 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
@@ -24,13 +24,14 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
return String::empty();
Function<String(JS::Value)> to_string_as_exception = [&](JS::Value value) {
+ auto& vm = cell->sheet().global_object().vm();
StringBuilder builder;
builder.append("Error: "sv);
if (value.is_object()) {
auto& object = value.as_object();
if (is<JS::Error>(object)) {
auto message = object.get_without_side_effects("message");
- auto error = message.to_string(cell->sheet().global_object());
+ auto error = message.to_string(vm);
if (error.is_throw_completion())
builder.append(message.to_string_without_side_effects());
else
@@ -38,7 +39,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
return builder.to_string();
}
}
- auto error_message = value.to_string(cell->sheet().global_object());
+ auto error_message = value.to_string(vm);
if (error_message.is_throw_completion())
return to_string_as_exception(*error_message.release_error().value());