summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-11-21 03:33:17 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-12-12 14:49:49 +0330
commit892e585e9aa5725193f006d1782312a23387d1b1 (patch)
tree23089f53912e35f530359a5684a990561f7ed189 /Userland/Applications/Spreadsheet
parent398f1ca842aba9acaf278b61a6f88f272626e4ee (diff)
downloadserenity-892e585e9aa5725193f006d1782312a23387d1b1.zip
Spreadsheet: Don't recreate the global environment on every evaluation
The worksheet's realm does not change, and is not shared, so we can safely leave the global environment be. This fixes lexical scoping in the spreadsheet's runtime file.
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r--Userland/Applications/Spreadsheet/Spreadsheet.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
index eeeee7670b..188a4d8e59 100644
--- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp
+++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
@@ -166,9 +166,6 @@ Sheet::ValueAndException Sheet::evaluate(StringView source, Cell* on_behalf_of)
if (parser.has_errors() || interpreter().exception())
return { JS::js_undefined(), interpreter().exception() };
- // FIXME: This creates a GlobalEnvironment for every evaluate call which we might be able to circumvent with multiple realms.
- interpreter().realm().set_global_object(global_object(), &global_object());
-
interpreter().run(global_object(), program);
if (interpreter().exception()) {
auto exc = interpreter().exception();