mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS/Bytecode: Make yield by itself yield undefined
This commit is contained in:
committed by
Andreas Kling
parent
0c8da1478a
commit
b914680f0c
@@ -1600,6 +1600,8 @@ Bytecode::CodeGenerationErrorOr<void> YieldExpression::generate_bytecode(Bytecod
|
||||
|
||||
if (m_argument)
|
||||
TRY(m_argument->generate_bytecode(generator));
|
||||
else
|
||||
generator.emit<Bytecode::Op::LoadImmediate>(js_undefined());
|
||||
|
||||
auto& continuation_block = generator.make_block();
|
||||
generator.emit<Bytecode::Op::Yield>(Bytecode::Label { continuation_block });
|
||||
|
||||
Reference in New Issue
Block a user