mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibJS/Bytecode: Make yield
by itself yield undefined
This commit is contained in:
parent
0c8da1478a
commit
b914680f0c
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/b914680f0c Pull-request: https://github.com/SerenityOS/serenity/pull/16196
1 changed files with 2 additions and 0 deletions
|
@ -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 });
|
||||
|
|
Loading…
Add table
Reference in a new issue