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
Notes: sideshowbarker 2024-07-19 01:57:20 +09:00
4 changed files with 32 additions and 5 deletions

View file

@ -2,8 +2,7 @@ test("'break' syntax errors", () => {
expect("break").not.toEval();
expect("break label").not.toEval();
expect("{ break }").not.toEval();
// FIXME: Parser does not throw error on nonexistent label
// expect("{ break label }.not.toEval();
expect("{ break label }").not.toEval();
expect("label: { break label }").toEval();
});