ladybird/Userland/Libraries/LibJS/Tests/for-loop-per-iteration-env-bug.js
Andreas Kling 9a7e6158af LibJS: Fix crash in bytecode generator on https://twinings.co.uk/
If the current block has already been terminated, we should just skip
creating a per-iteration environment.
2024-07-24 11:13:53 +02:00

12 lines
224 B
JavaScript

test("check that codegen doesn't crash", () => {
function func(x) {
expect(x()).toBe(0);
}
function go() {
for (let i = 0; ; ) {
func(() => i);
break;
}
}
});