Files
ladybird/Tests/LibJS/Bytecode/input/generator-yield.js
Andreas Kling fdd7809bd1 Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests
Created these while experimenting with LibJS. Might as well bring them
into the tree and increase our coverage.
2026-02-17 20:44:57 +01:00

14 lines
335 B
JavaScript

// Test that generator yield expressions produce correct bytecode:
// - Correct register reuse across multiple yields
// - No unnecessary register copies on the normal path
// - Proper completion protocol (Normal/Throw/Return dispatch)
function* multi_yield() {
yield 1;
yield 2;
}
var g = multi_yield();
g.next();
g.next();