LibJS: Allow SpreadExpressions to generate bytecode

This commit is contained in:
Hendiadyoin1 2022-09-02 23:39:04 +02:00 committed by Linus Groh
commit ab763a56f6
Notes: sideshowbarker 2024-07-17 20:33:50 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -1959,6 +1959,13 @@ Bytecode::CodeGenerationErrorOr<void> ClassExpression::generate_bytecode(Bytecod
return {};
}
Bytecode::CodeGenerationErrorOr<void> 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<void> ThisExpression::generate_bytecode(Bytecode::Generator& generator) const
{
generator.emit<Bytecode::Op::ResolveThisBinding>();