diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-21 14:00:56 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | a022e548b808df91c471cb55f0245e15957e89c4 (patch) | |
tree | d6a7d452eae1d06e537a2fd77348ecaab278614f /Userland/Applications/Spreadsheet/SpreadsheetModel.cpp | |
parent | f6c4a0f5d00a6a03a5165f1618516acb320f13a4 (diff) | |
download | serenity-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.cpp | 5 |
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()); |