File: optional-chains.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 (35 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (2)
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
issue_1586_optional_chain_inlined: {
    options = {
        module: true,
        inline: true,
        unused: true,
        reduce_vars: true,
    }
    input: {
        const fn = () => (foo(), bar())
        obj = {
            prop: fn?.(),
        }
    }
    expect: {
        obj = {
            prop: (foo(), bar()),
        }
    }
}

issue_1586_optional_chain_inlined_2: {
    options = {
        inline: true,
    }
    input: {
        obj = {
            prop: (() => (foo(), bar()))?.(),
        }
    }
    expect: {
        obj = {
            prop: (foo(), bar()),
        }
    }
}