mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
19 lines
645 B
JavaScript
19 lines
645 B
JavaScript
|
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("label: { break label }").toEval();
|
||
|
});
|
||
|
|
||
|
test("'continue' syntax errors", () => {
|
||
|
expect("continue").not.toEval();
|
||
|
expect("continue label").not.toEval();
|
||
|
expect("{ continue }").not.toEval();
|
||
|
expect("{ continue label }").not.toEval();
|
||
|
expect("label: { continue label }").not.toEval();
|
||
|
|
||
|
expect("switch (true) { case true: continue; }").not.toEval();
|
||
|
});
|