summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/break-continue-syntax-errors.js
blob: 106118823ff017e72a379c780a80290694a6a0a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
test("'break' syntax errors", () => {
    expect("break").not.toEval();
    expect("break label").not.toEval();
    expect("{ break }").not.toEval();
    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();
});