LibJS: Fix not executing the expression of a return statement

This commit is contained in:
Matthew Olsson 2021-06-08 16:29:21 -07:00 committed by Andreas Kling
parent a1e5711a27
commit f286cf1792
Notes: sideshowbarker 2024-07-18 12:35:42 +09:00

View File

@ -401,6 +401,8 @@ void CallExpression::generate_bytecode(Bytecode::Generator& generator) const
void ReturnStatement::generate_bytecode(Bytecode::Generator& generator) const
{
if (m_argument)
m_argument->generate_bytecode(generator);
generator.emit<Bytecode::Op::Return>();
}