aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-1275.js
blob: 5d4f5b706eb28e9af2f5c35ad2e2032aa3fee7b4 (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
46
47
48
49
50
string_plus_optimization: {
    options = {
        side_effects  : true,
        evaluate      : true,
        conditionals  : true,
        comparisons   : true,
        dead_code     : true,
        booleans      : true,
        unused        : true,
        if_return     : true,
        join_vars     : true,
        cascade       : true,
        hoist_funs    : true,
    };
    input: {
        function foo(anything) {
            function throwing_function() {
                throw "nope";
            }
            try {
                console.log('0' + throwing_function() ? "yes" : "no");
            } catch (ex) {
                console.log(ex);
            }
            console.log('0' + anything ? "yes" : "no");
            console.log(anything + '0' ? "Yes" : "No");
            console.log('' + anything);
            console.log(anything + '');
        }
        foo();
    }
    expect: {
        function foo(anything) {
            function throwing_function() {
                throw "nope";
            }
            try {
                console.log((throwing_function(), "yes"));
            } catch (ex) {
                console.log(ex);
            }
            console.log("yes");
            console.log("Yes");
            console.log('' + anything);
            console.log(anything + '');
        }
        foo();
    }
    expect_stdout: true
}
..Fixes <https://issues.guix.gnu.org/52140>. Reported by Guillaume Le Vaillant <glv@posteo.net>. * gnu/packages/c.scm (tcc): Update to a83b28568596afd8792fd58d1a5bd157fc6b6634. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Ekaitz Zarraga 2022-07-07gnu: Add cproc....* gnu/packages/c.scm (cproc): New variable. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> (unmatched-parenthesis 2022-07-03gnu: libfixposix: Add C_INCLUDE_PATH to the native-search-paths....* gnu/packages/c.scm (libfixposix)[native-search-paths]: Add C_INCLUDE_PATH. This fixes the loading of cl-iolib among others. Pierre Neidhardt 2022-07-03gnu: Add utest-h....* gnu/packages/c.scm (utest-h): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Artyom V. Poptsov