1
Fork 0
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:
Matthew Olsson 2020-10-08 10:49:08 -07:00 committed by Andreas Kling
parent 67f2301150
commit e8da5f99b1
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();
});