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();
});