mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibJS: Fix that non-existent references are unresolvable in strict mode
This commit is contained in:
parent
a49b47bfe6
commit
f8a869f2fc
1 changed files with 6 additions and 1 deletions
|
@ -414,7 +414,12 @@ Reference VM::get_identifier_reference(Environment* environment, FlyString const
|
|||
if (possible_match.has_value())
|
||||
return Reference { *environment, name, strict };
|
||||
}
|
||||
return Reference { global_object.environment(), name, strict };
|
||||
|
||||
if (global_object.environment().has_binding(name) || !in_strict_mode()) {
|
||||
return Reference { global_object.environment(), name, strict };
|
||||
}
|
||||
|
||||
return Reference { Reference::BaseType::Unresolvable, name, strict };
|
||||
}
|
||||
|
||||
// 9.4.2 ResolveBinding ( name [ , env ] ), https://tc39.es/ecma262/#sec-resolvebinding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue