1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

LibJS: Remove direct argument loading since it was buggy

The parser doesn't always track lexical scopes correctly, so let's not
rely on that for direct argument loading.

This reverts the LoadArguments bytecode instruction as well. We can
bring these things back when the parser can reliably tell us that
a given Identifier is indeed a function argument.
This commit is contained in:
Andreas Kling 2021-06-22 22:20:17 +02:00
parent 1082e99e08
commit 8a3c9d9851
9 changed files with 4 additions and 79 deletions

View file

@ -267,10 +267,7 @@ void RegExpLiteral::generate_bytecode(Bytecode::Generator& generator) const
void Identifier::generate_bytecode(Bytecode::Generator& generator) const
{
if (m_argument_index.has_value())
generator.emit<Bytecode::Op::LoadArgument>(m_argument_index.value());
else
generator.emit<Bytecode::Op::GetVariable>(generator.intern_string(m_string));
generator.emit<Bytecode::Op::GetVariable>(generator.intern_string(m_string));
}
void AssignmentExpression::generate_bytecode(Bytecode::Generator& generator) const