mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +00:00
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.
This commit is contained in:
parent
398f1ca842
commit
892e585e9a
1 changed files with 0 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue