aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-368.js
blob: 8c41a894501f9f6952769a29c47c47eedbcb23db (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
collapse: {
    options = {
        cascade: true,
        sequences: true,
        side_effects: true,
        unused: true,
    }
    input: {
        function f1() {
            var a;
            a = typeof b === 'function' ? b() : b;
            return a !== undefined && c();
        }
        function f2(b) {
            var a;
            b = c();
            a = typeof b === 'function' ? b() : b;
            return 'stirng' == typeof a && d();
        }
        function f3(c) {
            var a;
            a = b(a / 2);
            if (a < 0) {
                c++;
                return c / 2;
            }
        }
    }
    expect: {
        function f1() {
            return void 0 !== ('function' === typeof b ? b() : b) && c();
        }
        function f2(b) {
            return b = c(), 'stirng' == typeof ('function' === typeof b ? b() : b) && d();
        }
        function f3(c) {
            var a;
            if ((a = b(a / 2)) < 0) return c++ / 2;
        }
    }
}