1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibJS: Make ResolveBinding() produce strict References in strict mode

This commit is contained in:
Andreas Kling 2021-07-02 00:17:23 +02:00
parent db334b50d0
commit 57db058652

View file

@ -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<MarkedValueList> arguments)