LibJS: break or continue with nonexistent label is a syntax error

This commit is contained in:
Matthew Olsson 2020-10-08 10:49:08 -07:00 committed by Andreas Kling
commit e8da5f99b1
Notes: sideshowbarker 2024-07-19 01:57:20 +09:00
4 changed files with 32 additions and 5 deletions

View file

@ -37,3 +37,11 @@ test("labeled for loop with continue", () => {
}
expect(counter).toBe(6);
});
test("invalid label across scope", () => {
expect(`
label: {
(() => { break label; });
}
`).not.toEval();
});