mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
1082e99e08
commit
8a3c9d9851
Notes:
sideshowbarker
2024-07-18 11:38:59 +09:00
Author: https://github.com/awesomekling
Commit: 8a3c9d9851
9 changed files with 4 additions and 79 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue