Repository: mishoo/UglifyJS (JavaScript)

Issue:
ufuzz failure
```js
// original code
// (beautified)
var _calls_ = 10, a = 100, b = 10, c = 0;

{
    var brake2 = 5;
    L12036: while (--b + (a && a[[ ~a, a++ + (typeof a == "function" && --_calls_ >= 0 && a(0, "", 2)), [].NaN, --b + [ (c = c + 1) + ([ [ (c = 1 + c, 
    (38..toString() === -4 && 38..toString() >= "bar") << (-1 > "b" > (true == false))), (c = 1 + c, 
    (a && (a.c = 25 + 23..toString() - (2 >= false))) >>> (a && (a[--b + (1 - 4 > ([ , 0 ][1] == true) >= (c = c + 1, 
    3, true))] >>= delete [ , 0 ][1] ^ 2 >> -4))), (c = 1 + c, ((undefined === 23..toString()) <= 3 - 1) * (([] === "bar") >= ("undefined" == 22))), (c = 1 + c, 
    ((NaN && null) != (false, "a")) > (22 >= null) >>> ([ , 0 ].length === 2, "undefined")), ...[ (c = 1 + c, 
    ("c" << "foo") % (null * 38..toString()) < (25 % {} != -2 % "b")) ] ].a, null, --b + typeof b_2 ].NaN || 1).toString()[(c = c + 1) + [ [ (c = 1 + c, 
    "foo" / NaN <= ([ , 0 ][1] <= []) > NaN - /[a2][^e]+$/ - null % Infinity), (c = 1 + c, 
    (c = c + 1, [ , 0 ].length === 2 || NaN) >> (("number" && 5) ^ (22 | 5))), (c = 1 + c, 
    (/[a2][^e]+$/ << [ , 0 ][1]) / ("foo" > "foo") >= (NaN || null) - ("number" === 4)), (c = 1 + c, 
    c = c + 1, a = NaN >>> 4 <= [ , 0 ][1] * /[a2][^e]+$/), (c = 1 + c, delete ([ , 0 ].length === 2) <= [] >> "bar" > -(NaN && NaN)) ].b ]], new function b_2(a, b_2_2, b_2_2) {
        this.next = (b_2_2 && ({
            undefined: b_2_2[a++ + b++]
        } = {
            undefined: (0 ^ 25) - ("b" >= false) << ("object" ^ "" || (false || "object"))
        })) + ((2 % -3 !== ([] & -4)) >> (c = c + 1, "b" % "number")) & (((2 !== NaN) <= (Infinity, 
        3)) % (this < 4 > "number" >>> "number") || (a = (a && (a.var += -0 & -5 || (b_2_2 += "" >>> 2))) === (-4 - "" & (0 ^ 0))));
    }("foo"), a++ + (a && a.null), --b + (1 === 1 ? a : b), a++ + ({
        [a && a.next]: typeof (1 === 1 ? a : b),
        1.5: --b + /[abc4]/g.exec((typeof b_1 === "special" || b || 5).toString()),
        done: --b + (typeof a_1 != "object"),
        b: a && typeof a.in == "function" && --_calls_ >= 0 && a.in((c = 1 + c, ("number" ^ "a") - -4 % 38..toString() !== (-0 ^ 3) >= (/[a2][^e]+$/ === Infinity)), (c = 1 + c, 
        {} * -2 + (a && (a[c = 1 + c, +([ , 0 ].length === 2 ^ true) | (Infinity - {}) % (-0, 
        "bar")] = 38..toString() === undefined)) >>> (("b" || -2) ^ [] === "a")), (c = 1 + c, 
        (2 >> -1 === (22 && true)) + ([ , 0 ][1] < -0 > ([ , 0 ].length === 2 & undefined)))),
        in: a++ + a--
    }[("c" >= 2) >>> (2 & "object") != undefined + 2 <= (2 | {})] || 4).toString()[{
        [1 === 1 ? a : b]: --b + (--b + (0 === 1 ? a : b) || a || 3).toString(),
        next: (function b() {
        }() || 8).toString()[(c = c + 1) + {
            in: (c = 1 + c, ((Infinity ^ -1) < ("a" != "function")) / ("undefined" / -1 & ("a" ^ -2))),
            0: (c = 1 + c, (-2 | 22) % ("b" !== NaN) && (null ^ -0) !== (a /= -0 & -2)),
            done: (c = 1 + c, ("a" < -5 == 1 / NaN) - (c = c + 1, undefined / 4))
        }],
        value: a && typeof a.a == "function" && --_calls_ >= 0 && a.a((c = 1 + c, ("undefined" >= "b" ^ (a && (a.undefined = 24..toString() <= null))) > ({} >= "number") ** !24..toString()), (c = 1 + c, 
        (!-3 | 2 % "") !== (24..toString() - 0 || "function" >> [ , 0 ][1])))
    }] ].null ][[ a++ + (typeof b_2 !== "string"), /[abc4]/.test((--b + (("a" >>> -0) - (24..toString() || 3) && (-3 & "number", 
    2 >= -1)) || b || 5).toString()), ...[ --b + (a++ ? --b + (-4 in {
        length: a++,
        value: (c = c + 1) + [ (c = 1 + c, [ , 0 ][1] == Infinity & (a && (a[c = 1 + c, 
        delete (2 != "a") * (a && (a.done *= true / "" < (4 && "object")))] += (38..toString(), 
        null))) & (a = "object" == 23..toString() === (23..toString() || 25))), (c = 1 + c, 
        (a = undefined << "b") * ("" << -2) ^ ~25 != ("function" || [])) ],
        0: --b + function a_1() {},
        length: 1 === 1 ? a : b
    }) : typeof f1 == "function" && --_calls_ >= 0 && f1(1, "a", --b + 2)), --b + {
        next: --b + 23..toString()
    }.null, typeof ++b, /[abc4]/.test((--b + (1 === 1 ? a : b) || b || 5).toString()), a++ + void (38..toString() != -0 & (22 ^ "") | (c = c + 1, 
    2 - "number")) ? (c = c + 1) + (--b + ([ , 0 ].length === 2)) : a++ + (typeof Infinity_1 == "special") ] ][[ a++ + (a && a.length), (c = c + 1) + a, a++ + (23..toString() in {
        then: (c = c + 1) + (a && typeof a.undefined == "function" && --_calls_ >= 0 && a.undefined(-1))
    }), ..."" + a, (c = c + 1) + {
        [--b + (a && a[--b + a])]: typeof ((c = c + 1) + (typeof foo_1 === "function")),
        next: (c = c + 1) + (b = a),
        foo: a++ + (a = delete (("foo" != 4 != (4 || 2)) <= ("bar" + [ , 0 ][1] != 1 << 23..toString()))),
        then: typeof a == "function" && --_calls_ >= 0 && a(--b + a, typeof f1 == "function" && --_calls_ >= 0 && f1("function"), "undefined")
    } ].null]]]) && --brake2 > 0) {
        var brake3 = 5;
        while (typeof f0 == "function" && --_calls_ >= 0 && f0(--b + (typeof f1 == "function" && --_calls_ >= 0 && f1((c = c + 1) + ++a)), ...[ a++ + {
            [(c = c + 1, 38..toString() > "function") < (c = c + 1, 4 === -1)]: [ (c = c + 1) + (a && typeof a.b == "function" && --_calls_ >= 0 && a.b((c = 1 + c, 
            ("bar" > "undefined" & (38..toString() || "c")) * ((22 === "foo") % ("c" == undefined))), (c = 1 + c, 
            (0 !== "c") >= (4 > "function") <= (1 << -4) * ([ , 0 ].length === 2 & "a")))), (c = c + 1) + (a += a++ + "number") ],
            "\t": --b + (--b + ((c = c + 1) + [][[ (c = 1 + c, c = c + 1, "undefined" == this | (a && (a[c = 1 + c, 
            (a && (a[c = 1 + c, (-3 < 25) >>> (a && (a.null = "" / 25)) << ((Infinity >= 24..toString()) >>> void -4)] = "number" < "object")) % (/[a2][^e]+$/ < "c"), 
            this % [] & (undefined ^ undefined)] = "function" % "bar"))), (c = 1 + c, (-2 + null) / ("b" ^ -5) <= (this < Infinity) + (/[a2][^e]+$/ >> "b")), (c = 1 + c, 
            ("foo" / undefined | void "") != Infinity - null << ("bar", {})), (c = 1 + c, ("bar" / [ , 0 ][1] || ("number" || 1)) >= (23..toString() != -5) << ([ , 0 ].length === 2 == 0)) ][c = 1 + c, 
            -(null << 0 ^ "object" >> -0)]] || a || 3).toString() || a || 3).toString(),
            [(c = c + 1) + a]: ([ , (c = 1 + c, ~23..toString() < (NaN ^ "foo") <= 23..toString() * -2 / ([] ^ "b")), (c = 1 + c, 
            ("foo" || 3) - (a && (a[c = 1 + c, a && (a.null -= NaN * -1 >= ("a" || [ , 0 ].length === 2) !== (-1 | "b") / (a && (a.null += "foo" || [])))] = "c" | 3)) >> ("foo" + -3) * ("a" >> 22)), (c = 1 + c, 
            NaN % 22 <= (a && ([ a.then ] = [ "function" !== 1 ])) === "foo" <= 38..toString() <= Infinity % "b") ].var ? function* b_2() {
                c = 1 + c, (22 * null <= "" - "") + (b_2 && ([ b_2.then ] = [ (null && "object", 
                -1 * 0) ]));
                c = 1 + c, (false != 38..toString()) - (NaN << "bar") <= ("object" < 38..toString()) - (c = c + 1, 
                "b");
            } : a++ + ([ a ] = [ ...[ (c = 1 + c, null * -5 << (5 >>> 5), (a = -0 / {}) | 5 === {}), (c = 1 + c, 
            (25 && 23..toString()) ^ "bar" != ([ , 0 ].length === 2) ^ ((undefined | 38..toString()) ^ [ , 0 ][1] * 1)), ...[ (c = 1 + c, 
            (4 && 25) + (a && (a.value += 4 ^ 22)) <= ((a = [] === "function") === (c = c + 1, 
            -0))), (c = 1 + c, (Infinity, "c") > ([ , 0 ].length === 2) % undefined ^ (2 !== -3) <= [] >>> 0), ..."" + a, (c = 1 + c, 
            ("bar" / {} || 1 & "undefined") / (a = {} >>> 3 != (3 === "function"))), (c = 1 + c, 
            (-4 ^ -2 ^ (2 | "c")) << (a *= 22 ^ 0) - (-0 << -5)) ], (c = 1 + c, +("function" === false) * ((a = NaN << "function") > ("object" == -5))), (c = 1 + c, 
            ("number" % 24..toString() === 23..toString() - Infinity) <= (-4 <= Infinity & ([] ^ 1))) ], (c = 1 + c, 
            ("foo" || undefined) - (NaN << "") === (c = c + 1, 1) % (0 !== false)), (c = 1 + c, 
            (this ^ NaN) != ([] & -4) == ("c" || -0, -5 % NaN)) ])) ? a : ++a,
            "-2": (--b + (a && a.undefined) || a || 3).toString()
        }[1 === 1 ? a : b] ], ..."" + a) && --brake3 > 0) {
            var brake6 = 5;
            do {
                {
                    var b = function f0() {
                        {}
                        L12037: {
                            L12038: {}
                            return;
                        }
                    }(-3, "number", [ , 0 ][1]);
                }
            } while (a-- && --brake6 > 0);
        }
    }
}

console.log(null, a, b, c, Infinity, NaN, undefined);
```
```
// !!! uglify failed !!!
Error: Cannot negate a statement
    at AST_GeneratorFunction.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9655:19)
    at AST_GeneratorFunction.eval [as negate] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9715:25)
    at AST_Conditional.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9681:47)
    at AST_Conditional.eval [as negate] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9715:25)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:15454:33)
    at AST_Conditional.eval [as optimize] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:16218:19)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5429:24)
    at AST_Conditional.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Conditional.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2221:33)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_ObjectKeyVal.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_ObjectKeyVal.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2217:27)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Object.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Object.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2183:43)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Sub.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Sub.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2194:33)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Binary.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Binary.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2202:25)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Array.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Array.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2187:43)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Spread.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Spread.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2168:21)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Call.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Call.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2194:33)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Binary.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Binary.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2193:31)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Binary.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Binary.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2092:41)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_While.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_While.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2085:21)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_BlockStatement.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_BlockStatement.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2093:31)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_While.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_While.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2079:31)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_LabeledStatement.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_LabeledStatement.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2085:21)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_BlockStatement.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_BlockStatement.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2085:21)
    at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
    at AST_Toplevel.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
    at AST_Toplevel.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
    at Compressor.compress (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5383:25)
    at Object.minify (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:19201:57)
    at /home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2092:32
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2088:20)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
```
```js
// reduced test case (output will differ)

// (beautified)
(0..var ? function* b_2() {} : 0) ? 0 : 0;
// minify error: Error: Cannot negate a statement
//     at AST_GeneratorFunction.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9655:19)
//     at AST_GeneratorFunction.eval [as negate] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9715:25)
//     at AST_Binary.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9703:41)
//     at AST_Binary.eval [as negate] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:9715:25)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:15454:33)
//     at AST_Conditional.eval [as optimize] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:16218:19)
//     at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5429:24)
//     at AST_Conditional.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
//     at AST_Conditional.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2082:31)
//     at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
//     at AST_SimpleStatement.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
//     at AST_SimpleStatement.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2072:25)
//     at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:120:23)
//     at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2071:16)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2085:21)
//     at Compressor.before (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5424:9)
//     at AST_Toplevel.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2231:31)
//     at AST_Toplevel.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:438:34)
//     at Compressor.compress (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:5383:25)
//     at Object.minify (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:19201:57)
//     at test_minify (/home/runner/work/UglifyJS/UglifyJS/test/reduce.js:748:22)
//     at reduce_test (/home/runner/work/UglifyJS/UglifyJS/test/reduce.js:594:20)
//     at log (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:1879:23)
//     at /home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2152:80
//     at Array.forEach (<anonymous>)
//     at Object.<anonymous> (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2088:20)
//     at Module._compile (module.js:653:30)
//     at Object.Module._extensions..js (module.js:664:10)
//     at Module.load (module.js:566:32)
//     at tryModuleLoad (module.js:506:12)
//     at Function.Module._load (module.js:498:3)
//     at Function.Module.runMain (module.js:694:10)
//     at startup (bootstrap_node.js:204:16)
//     at bootstrap_node.js:625:3
// options: {
//   "mangle": false,
//   "output": {
//     "v8": true
//   },
//   "validate": true
// }
```
```
minify(options):
{
  "mangle": false,
  "output": {
    "v8": true
  }
}

Suspicious compress options:
  conditionals
```


Discussion:

Patch:
diff --git a/lib/compress.js b/lib/compress.js
index 9e9f15f65ac..591f28a8a1f 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4466,34 +4466,6 @@ merge(Compressor.prototype, {
         def(AST_Statement, function() {
             throw new Error("Cannot negate a statement");
         });
-        def(AST_Arrow, function() {
-            return basic_negation(this);
-        });
-        def(AST_AsyncArrow, function() {
-            return basic_negation(this);
-        });
-        def(AST_AsyncFunction, function() {
-            return basic_negation(this);
-        });
-        def(AST_Function, function() {
-            return basic_negation(this);
-        });
-        def(AST_UnaryPrefix, function() {
-            if (this.operator == "!")
-                return this.expression;
-            return basic_negation(this);
-        });
-        def(AST_Sequence, function(compressor) {
-            var expressions = this.expressions.slice();
-            expressions.push(expressions.pop().negate(compressor));
-            return make_sequence(this, expressions);
-        });
-        def(AST_Conditional, function(compressor, first_in_statement) {
-            var self = this.clone();
-            self.consequent = self.consequent.negate(compressor);
-            self.alternative = self.alternative.negate(compressor);
-            return best(this, self, first_in_statement);
-        });
         def(AST_Binary, function(compressor, first_in_statement) {
             var self = this.clone(), op = this.operator;
             if (compressor.option("unsafe_comps")) {
@@ -4522,6 +4494,25 @@ merge(Compressor.prototype, {
             }
             return basic_negation(this);
         });
+        def(AST_Conditional, function(compressor, first_in_statement) {
+            var self = this.clone();
+            self.consequent = self.consequent.negate(compressor);
+            self.alternative = self.alternative.negate(compressor);
+            return best(this, self, first_in_statement);
+        });
+        def(AST_LambdaExpression, function() {
+            return basic_negation(this);
+        });
+        def(AST_Sequence, function(compressor) {
+            var expressions = this.expressions.slice();
+            expressions.push(expressions.pop().negate(compressor));
+            return make_sequence(this, expressions);
+        });
+        def(AST_UnaryPrefix, function() {
+            if (this.operator == "!")
+                return this.expression;
+            return basic_negation(this);
+        });
     })(function(node, func) {
         node.DEFMETHOD("negate", function(compressor, first_in_statement) {
             return func.call(this, compressor, first_in_statement);


Test patch:
diff --git a/test/compress/yields.js b/test/compress/yields.js
index 2c06a4ac2a7..2d29c9b603e 100644
--- a/test/compress/yields.js
+++ b/test/compress/yields.js
@@ -587,3 +587,18 @@ issue_4618: {
     expect_stdout: "function"
     node_version: ">=4"
 }
+
+issue_4623: {
+    options = {
+        conditionals: true,
+    }
+    input: {
+        if (console ? function*() {} : 0)
+            console.log("PASS");
+    }
+    expect: {
+        (console ? function*() {} : 0) && console.log("PASS");
+    }
+    expect_stdout: "PASS"
+    node_version: ">=4"
+}