1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibJS: Teach Reference to access call frame arguments directly

This commit is contained in:
Andreas Kling 2021-06-14 10:52:15 +02:00
parent 91fbeeab72
commit 6e0e8a8242
3 changed files with 20 additions and 0 deletions

View file

@ -668,6 +668,8 @@ Reference Expression::to_reference(Interpreter&, GlobalObject&) const
Reference Identifier::to_reference(Interpreter& interpreter, GlobalObject&) const
{
if (m_argument_index.has_value())
return Reference(Reference::CallFrameArgument, m_argument_index.value(), string());
return interpreter.vm().get_reference(string());
}