diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-22 22:20:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-22 22:20:17 +0200 |
commit | 8a3c9d98514cd73e30059983089f3a0d33b86819 (patch) | |
tree | 99018e0e334cc92e0688c18fdc36bc26a83cb128 /Userland/Libraries/LibJS/AST.h | |
parent | 1082e99e08290d21a699ad8b79a4b2027a8139f7 (diff) | |
download | serenity-8a3c9d98514cd73e30059983089f3a0d33b86819.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/AST.h')
-rw-r--r-- | Userland/Libraries/LibJS/AST.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 1a1fca4bc9..457a20e8c3 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -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 { |