Spreadsheet: Always keep the workbook interpreter in VM scope

Fixes #3570.
This commit is contained in:
AnotherTest 2020-09-21 01:31:49 +03:30 committed by Andreas Kling
parent cba5a69f07
commit e7f5090808
Notes: sideshowbarker 2024-07-19 02:19:02 +09:00
2 changed files with 2 additions and 0 deletions

View file

@ -48,6 +48,7 @@ static JS::VM& global_vm()
Workbook::Workbook(NonnullRefPtrVector<Sheet>&& sheets)
: m_sheets(move(sheets))
, m_interpreter(JS::Interpreter::create<JS::GlobalObject>(global_vm()))
, m_interpreter_scope(JS::VM::InterpreterScope(interpreter()))
{
m_workbook_object = interpreter().heap().allocate<WorkbookObject>(global_object(), *this);
global_object().put("workbook", workbook_object());

View file

@ -66,6 +66,7 @@ public:
private:
NonnullRefPtrVector<Sheet> m_sheets;
NonnullOwnPtr<JS::Interpreter> m_interpreter;
JS::VM::InterpreterScope m_interpreter_scope;
WorkbookObject* m_workbook_object { nullptr };
String m_current_filename;