mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +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
9 changed files with 4 additions and 79 deletions
|
@ -776,15 +776,13 @@ private:
|
|||
|
||||
class Identifier final : public Expression {
|
||||
public:
|
||||
explicit Identifier(SourceRange source_range, FlyString string, Optional<size_t> argument_index = {})
|
||||
explicit Identifier(SourceRange source_range, FlyString string)
|
||||
: Expression(source_range)
|
||||
, m_string(move(string))
|
||||
, m_argument_index(move(argument_index))
|
||||
{
|
||||
}
|
||||
|
||||
FlyString const& string() const { return m_string; }
|
||||
Optional<size_t> const& argument_index() const { return m_argument_index; }
|
||||
|
||||
virtual Value execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
@ -795,7 +793,6 @@ private:
|
|||
virtual bool is_identifier() const override { return true; }
|
||||
|
||||
FlyString m_string;
|
||||
Optional<size_t> m_argument_index;
|
||||
};
|
||||
|
||||
class ClassMethod final : public ASTNode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue