Files
ladybird/Tests/LibJS/Bytecode/input/for-of-continue-with-block-scope.js
Andreas Kling f0c34d54a1 Tests/LibJS: Add bytecode test for for-of continue with block scope
Test that continue inside a for-of loop body properly restores the
lexical environment when the for-of creates a per-iteration scope
for the loop variable.
2026-03-01 21:20:54 +01:00

14 lines
216 B
JavaScript

function f(e) {
const t = [];
for (const r of e) {
if (!r) {
t.push(r);
continue;
}
const o = t.find(i => r.x === i.x);
o;
}
return t;
}
f([]);