|
@@ -392,8 +392,10 @@ ThrowCompletionOr<void> GetVariable::execute_impl(Bytecode::Interpreter& interpr
|
|
|
auto const& string = interpreter.current_executable().get_identifier(m_identifier);
|
|
|
if (m_cached_environment_coordinate.has_value()) {
|
|
|
Environment* environment = nullptr;
|
|
|
+ bool coordinate_screwed_by_delete_in_global_environment = false;
|
|
|
if (m_cached_environment_coordinate->index == EnvironmentCoordinate::global_marker) {
|
|
|
environment = &interpreter.vm().current_realm()->global_environment();
|
|
|
+ coordinate_screwed_by_delete_in_global_environment = !TRY(environment->has_binding(string));
|
|
|
} else {
|
|
|
environment = vm.running_execution_context().lexical_environment;
|
|
|
for (size_t i = 0; i < m_cached_environment_coordinate->hops; ++i)
|
|
@@ -401,7 +403,7 @@ ThrowCompletionOr<void> GetVariable::execute_impl(Bytecode::Interpreter& interpr
|
|
|
VERIFY(environment);
|
|
|
VERIFY(environment->is_declarative_environment());
|
|
|
}
|
|
|
- if (!environment->is_permanently_screwed_by_eval()) {
|
|
|
+ if (!coordinate_screwed_by_delete_in_global_environment && !environment->is_permanently_screwed_by_eval()) {
|
|
|
return Reference { *environment, string, vm.in_strict_mode(), m_cached_environment_coordinate };
|
|
|
}
|
|
|
m_cached_environment_coordinate = {};
|