2020-10-07 12:21:15 -07:00
|
|
|
test("'break' syntax errors", () => {
|
|
|
|
expect("break").not.toEval();
|
|
|
|
expect("break label").not.toEval();
|
|
|
|
expect("{ break }").not.toEval();
|
2020-10-08 10:49:08 -07:00
|
|
|
expect("{ break label }").not.toEval();
|
2020-10-07 12:21:15 -07:00
|
|
|
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();
|
|
|
|
});
|