https://github.com/mishoo/UglifyJS
Raw File
Tip revision: 7ccdf3337b8c08e560870d4e440d52f176a252ae authored by Alex Lam S.L on 24 April 2019, 06:05:07 UTC
v3.5.7
Tip revision: 7ccdf33
issue-1443.js
// tests assume that variable `undefined` not redefined and has `void 0` as value

unsafe_undefined: {
    options = {
        conditionals: true,
        if_return: true,
        unsafe_undefined: true,
    }
    mangle = {}
    input: {
        function f(undefined) {
            return function() {
                if (a)
                    return b;
                if (c)
                    return d;
            };
        }
    }
    expect: {
        function f(n) {
            return function() {
                return a ? b : c ? d : n;
            };
        }
    }
}

keep_fnames: {
    options = {
        conditionals: true,
        if_return: true,
        unsafe_undefined: true,
    }
    mangle = {
        keep_fnames: true
    }
    input: {
        function f(undefined) {
            return function() {
                function n(a) {
                    return a * a;
                }
                if (a)
                    return b;
                if (c)
                    return d;
            };
        }
    }
    expect: {
        function f(r) {
            return function() {
                function n(n) {
                    return n * n;
                }
                return a ? b : c ? d : r;
            };
        }
    }
}
back to top