mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
LibJS: Make References see into Environment's bindings as well
'bindings' is the spec-compliant version of 'variables', but we were simply not even looking at them, which made things using bindings (such as named function expressions) break in unexpected ways after the move to using references in call expressions. Co-Authored-By: davidot <david.tuin@gmail.com>
This commit is contained in:
parent
3f31f109b5
commit
53d24fbd65
3 changed files with 25 additions and 5 deletions
|
@ -417,6 +417,8 @@ Reference VM::get_identifier_reference(Environment* environment, FlyString name,
|
|||
auto possible_match = environment->get_from_environment(name);
|
||||
if (possible_match.has_value())
|
||||
return Reference { *environment, move(name), strict };
|
||||
if (environment->has_binding(name))
|
||||
return Reference { *environment, move(name), strict };
|
||||
}
|
||||
|
||||
auto& global_environment = interpreter().realm().global_environment();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue