From 57db0586521008041abcb9b62b0606f414aaa88c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 2 Jul 2021 00:17:23 +0200 Subject: [PATCH] LibJS: Make ResolveBinding() produce strict References in strict mode --- Userland/Libraries/LibJS/Runtime/VM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 48877aa0a1..68d9e28c49 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -400,9 +400,9 @@ Reference VM::resolve_binding(GlobalObject& global_object, FlyString const& name for (auto* environment = lexical_environment(); environment && environment->outer_environment(); environment = environment->outer_environment()) { auto possible_match = environment->get_from_environment(name); if (possible_match.has_value()) - return Reference { *environment, name }; + return Reference { *environment, name, in_strict_mode() }; } - return Reference { global_object.environment(), name }; + return Reference { global_object.environment(), name, in_strict_mode() }; } Value VM::construct(FunctionObject& function, FunctionObject& new_target, Optional arguments)