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
commit 8a3c9d9851
Notes: sideshowbarker 2024-07-18 11:38:59 +09:00
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