1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Spreadsheet: No longer use vm.exception() to signal exception state

Instead, use the completions which are returned directly. This means we
no longer have to worry about the global VM state when running code.
This commit is contained in:
davidot 2022-02-07 15:00:40 +01:00 committed by Linus Groh
parent e160f508a8
commit 4ef1e8f226
11 changed files with 98 additions and 97 deletions

View file

@ -49,8 +49,13 @@ struct Cell : public Weakable<Cell> {
bool dirty() const { return m_dirty; }
void clear_dirty() { m_dirty = false; }
void set_exception(JS::Exception* exc) { m_js_exception = exc; }
JS::Exception* exception() const { return m_js_exception; }
void set_thrown_value(JS::Value value) { m_thrown_value = value; }
Optional<JS::Value> thrown_value() const
{
if (m_thrown_value.is_empty())
return {};
return m_thrown_value;
}
const String& data() const { return m_data; }
const JS::Value& evaluated_data() const { return m_evaluated_data; }
@ -103,7 +108,7 @@ private:
bool m_evaluated_externally { false };
String m_data;
JS::Value m_evaluated_data;
JS::Exception* m_js_exception { nullptr };
JS::Value m_thrown_value;
Kind m_kind { LiteralString };
WeakPtr<Sheet> m_sheet;
Vector<WeakPtr<Cell>> m_referencing_cells;