mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS: break or continue with nonexistent label is a syntax error
This commit is contained in:
parent
67f2301150
commit
e8da5f99b1
Notes:
sideshowbarker
2024-07-19 01:57:20 +09:00
Author: https://github.com/mattco98
Commit: e8da5f99b1
Pull-request: https://github.com/SerenityOS/serenity/pull/3724
Issue: https://github.com/SerenityOS/serenity/issues/3714
Reviewed-by: https://github.com/linusg
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