aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-1447.js
blob: 3c881058fe58dceab344534bae915c90b9ef3c08 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
else_with_empty_block: {
    options = {}
    input: {
        if (x)
            yes();
        else {
        }
    }
    expect_exact: "if(x)yes();"
}

else_with_empty_statement: {
    options = {}
    input: {
        if (x)
            yes();
        else
            ;
    }
    expect_exact: "if(x)yes();"
}

conditional_false_stray_else_in_loop: {
    options = {
        booleans: true,
        comparisons: true,
        conditionals: false,
        dead_code: true,
        evaluate: true,
        hoist_vars: true,
        if_return: true,
        join_vars: true,
        loops: true,
        side_effects: true,
        unused: true,
    }
    input: {
        for (var i = 1; i <= 4; ++i) {
            if (i <= 2) continue;
            console.log(i);
        }
    }
    expect_exact: "for(var i=1;i<=4;++i)if(!(i<=2))console.log(i);"
    expect_stdout: true
}