File: issue-208.js

package info (click to toggle)
node-terser 5.46.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,248 kB
  • sloc: javascript: 101,516; makefile: 52; perl: 48; sh: 13
file content (66 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (4)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
do_not_update_lhs: {
    options = {
        global_defs: {
            DEBUG: 0,
        },
    }
    input: {
        DEBUG++;
        DEBUG += 1;
        DEBUG = 1;
    }
    expect: {
        DEBUG++;
        DEBUG += 1;
        DEBUG = 1;
    }
}

do_update_rhs: {
    options = {
        global_defs: {
            DEBUG: 0,
        },
    }
    input: {
        MY_DEBUG = DEBUG;
        MY_DEBUG += DEBUG;
    }
    expect: {
        MY_DEBUG = 0;
        MY_DEBUG += 0;
    }
}

mixed: {
    options = {
        evaluate: true,
        global_defs: {
            DEBUG: 0,
            ENV: 1,
            FOO: 2,
        },
    }
    input: {
        const ENV = 3;
        var FOO = 4;
        f(ENV * 10);
        --FOO;
        DEBUG = 1;
        DEBUG++;
        DEBUG += 1;
        f(DEBUG);
        x = DEBUG;
    }
    expect: {
        const ENV = 3;
        var FOO = 4;
        f(10);
        --FOO;
        DEBUG = 1;
        DEBUG++;
        DEBUG += 1;
        f(0);
        x = 0;
    }
}