mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
LibJS: Make Identifier::execute() actually use the lookup cache
If we have cached environment coordinates for an Identifier, we have to call to_reference() to actually make use of them. :^)
This commit is contained in:
parent
d7e5a2058d
commit
6ff9931dde
1 changed files with 2 additions and 1 deletions
|
@ -2543,7 +2543,8 @@ Completion Identifier::execute(Interpreter& interpreter) const
|
|||
auto& vm = interpreter.vm();
|
||||
|
||||
// 1. Return ? ResolveBinding(StringValue of Identifier).
|
||||
auto reference = TRY(vm.resolve_binding(m_string));
|
||||
// OPTIMIZATION: We call Identifier::to_reference() here, which acts as a caching layer around ResolveBinding.
|
||||
auto reference = TRY(to_reference(interpreter));
|
||||
|
||||
// NOTE: The spec wants us to return the reference directly; this is not possible with ASTNode::execute() (short of letting it return a variant).
|
||||
// So, instead of calling GetValue at the call site, we do it here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue