1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:07:35 +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

@ -651,22 +651,6 @@ private:
HashMap<u32, Variable> m_variables;
};
class LoadArgument final : public Instruction {
public:
explicit LoadArgument(size_t index)
: Instruction(Type::LoadArgument)
, m_index(index)
{
}
void execute_impl(Bytecode::Interpreter&) const;
String to_string_impl(Bytecode::Executable const&) const;
void replace_references_impl(BasicBlock const&, BasicBlock const&) { }
private:
size_t m_index { 0 };
};
class GetIterator final : public Instruction {
public:
GetIterator()