diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 6debd070b8..c8b52f24e0 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -1436,6 +1436,7 @@ public: virtual Completion execute(Interpreter&) const override; virtual void dump(int indent) const override; + virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; private: NonnullRefPtr m_target; diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 7c3bec1fe7..dea665a4b5 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -1959,6 +1959,13 @@ Bytecode::CodeGenerationErrorOr ClassExpression::generate_bytecode(Bytecod return {}; } +Bytecode::CodeGenerationErrorOr SpreadExpression::generate_bytecode(Bytecode::Generator& generator) const +{ + // NOTE: All users of this should handle the behaviour of this on their own, + // assuming it returns an Array-like object + return m_target->generate_bytecode(generator); +} + Bytecode::CodeGenerationErrorOr ThisExpression::generate_bytecode(Bytecode::Generator& generator) const { generator.emit();