diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-22 19:35:23 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | 275dea9d98a147e891b95f054c74c8198478a223 (patch) | |
tree | 566c86470b09ec5a15bb0760e77b1776b515796d /Userland/Applications/Spreadsheet/Spreadsheet.cpp | |
parent | b345a0acca725d1b4e4d6df26fc602d69e97f073 (diff) | |
download | serenity-275dea9d98a147e891b95f054c74c8198478a223.zip |
LibJS: Remove {Bytecode::,}Interpreter::global_object()
The basic idea is that a global object cannot just come out of nowhere,
it must be associated to a realm - so get it from there, if needed.
This is to enforce the changes from all the previous commits by not
handing out global objects unless you actually have an initialized
realm (either stored somewhere, or the VM's current realm).
Diffstat (limited to 'Userland/Applications/Spreadsheet/Spreadsheet.cpp')
-rw-r--r-- | Userland/Applications/Spreadsheet/Spreadsheet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index e5da87ac9b..c8e3c4ab4a 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -43,7 +43,7 @@ Sheet::Sheet(Workbook& workbook) , m_interpreter(JS::Interpreter::create<SheetGlobalObject>(m_workbook.vm(), *this)) { JS::DeferGC defer_gc(m_workbook.vm().heap()); - m_global_object = static_cast<SheetGlobalObject*>(&m_interpreter->global_object()); + m_global_object = static_cast<SheetGlobalObject*>(&m_interpreter->realm().global_object()); global_object().define_direct_property("workbook", m_workbook.workbook_object(), JS::default_attributes); global_object().define_direct_property("thisSheet", &global_object(), JS::default_attributes); // Self-reference is unfortunate, but required. |