mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 18:15:09 +00:00
LibJS: break or continue with nonexistent label is a syntax error
This commit is contained in:
parent
67f2301150
commit
e8da5f99b1
4 changed files with 32 additions and 5 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue