{"action":"closed","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2570","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2570/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2570/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2570/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/2570","id":280783507,"number":2570,"title":"ufuzz: possible false positive","user":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars3.githubusercontent.com/u/1898413?v=4","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-10T05:12:30Z","updated_at":"2017-12-10T06:19:13Z","closed_at":"2017-12-10T06:19:13Z","author_association":"COLLABORATOR","body":"```js\r\n// original code\r\n//\r\n\r\nvar a = 100, b = 10, c = 0;\r\ntry {{var expr2 = ((--b) + ( ((((--b) + (-a))) || a || 3).toString() ));  for (var key2 in expr2) {c = 1 + c; var a_2 = expr2[key2]; var parseInt_2 = (({\r\nnull:(((--b) + ((((0x26.toString()&&23..toString())^(\"foo\"||22))<(((-2)<=0)%((-3)<<(-3))))))),\r\nfoo:(((--b) + ([(({\r\n})), (a++), ((c = c + 1) + (a++)), (a++ + ([(function (){\r\n\r\n(c = 1 + c, (((0x26.toString()>=23..toString())/(\"\" + 25. ))<=((0!=\"undefined\") - (true&&false))));\r\n(c = 1 + c, ((delete ((parseInt_2 && (parseInt_2.NaN%=(\"object\" + 24 .toString())))))|(([,0][1]!==\"foo\")==(\"function\">>NaN))));\r\n(c = 1 + c, (a_2=(((\"undefined\"===24 .toString())||((-4)<-0))==((-0&&\"function\")==(parseInt_2 && (parseInt_2[(c = 1 + c, (a_2 && (a_2.undefined=(((this>>>25. )^(\"foo\"/([,0].length === 2)))<<(c = c + 1, (4 - \"undefined\"))))))]<<=(([,0].length === 2)>>24 .toString())))))));\r\n\r\n}), ( /[abc4]/.test((((parseInt_2 && parseInt_2[(c = 1 + c, (((\"object\"^({}))|(([,0].length === 2)^1))/((null/[,0][1])|(a_2=(1|[,0][1])))))])) || b || 5).toString()) ), , (((c = c + 1) + ([(c = 1 + c, (((23..toString()<<\"foo\")*(24 .toString()>=\"bar\")) + (a_2 && (a_2[((--b) + ((c = 1 + c, ((a_2=((-(undefined))*(\"foo\" - 24 .toString())))&((23..toString()^24 .toString())==((-5)>=(-2)))))?(c = 1 + c, (((void (({})))<(23..toString()<-0))>((a_2 && (a_2[(c = 1 + c, (((\"\"==\"object\"),(c = c + 1, (-4)))===(c = c + 1, (23..toString()^3))))]=([,0][1]^true))) + (\"bar\"===4)))):(c = 1 + c, (parseInt_2 && (parseInt_2.null>>=((((-1)%0)==(NaN/(-1)))^(parseInt_2=((void (Infinity)) + (-0==Infinity)))))))))]=((\"bar\" - (-5)),(25.  - ({}))))))), (c = 1 + c, (((Infinity^-0)*(parseInt_2+=(4&&true)))===((c = c + 1, 23..toString())>>(-0<<0x26.toString())))), (c = 1 + c, ((parseInt_2=((\"number\" + \"object\")!==(([,0].length === 2)|({}))))/(((-2),false)===(2==23..toString())))), ].null))), ((c = c + 1) + (b += a)), ])), ((c = c + 1) + ([])), ][((--b) + (0 === 1 ? a : b))]))),\r\nget null(){\r\n\r\n{var brake7 = 5; while (((a++ + (\"object\"))) && --brake7 > 0)if ((a++ + ([((c = c + 1) + (({\r\n0:((c = 1 + c, ((parseInt_2 && (parseInt_2.null+=((a_2 && (a_2[(c = 1 + c, (((Infinity|0x26.toString()),(\"foo\" - this))>=((\"foo\"!=(-5))||(undefined||5))))]=(\"number\", /[a2][^e]+$/ )))<<(c = c + 1, ({})))))>=((\"undefined\">>>22)===(a_2=([] - (-3))))))),\r\n\"-2\":((c = 1 + c, (!(((\"\"!==(-1))&(\"object\"==22)))))),\r\n}).null)), ([(c = 1 + c, (((\"\"||[,0][1])&&(parseInt_2 && (parseInt_2.null+=(\"bar\"&&\"function\"))))>((Infinity>=0x26.toString())%((-5)&&(-4))))), (c = 1 + c, (((parseInt_2+=(22&\"object\"))/(a_2 && (a_2[(c = 1 + c, ((void ((([,0].length === 2)*true)))|((parseInt_2 && (parseInt_2[(c = 1 + c, (+(((22*this)>>(23..toString()<(-3))))))]=((-1)<< /[a2][^e]+$/ )))>(null%(-3)))))]=([]==(-4)))))<=((NaN*1) - (2!=-0)))), ]), (++a), ])))switch (((--b) + (NaN))) { \r\ndefault:\r\nfor (var brake10 = 5; ((c = 1 + c, (((\"foo\"<=\"bar\")||(this^Infinity))==((1==NaN)===(([,0].length === 2)*\"undefined\"))))) && brake10 > 0; --brake10)(c = 1 + c, (void (((null<=-0) + ((-5)>22)))));\r\nswitch ((c = 1 + c, (((\"bar\" - 4)^(2<<24 .toString()))===((a_2 && (a_2.foo=([,0][1]^\"foo\")))===(NaN*\"number\"))))) { \r\ncase (c = 1 + c, ((-((\"number\">>\"\")))<<(([,0][1]!=this)^([,0][1]*\"bar\")))):\r\n;\r\n break;\r\n\r\ncase (c = 1 + c, ((c = c + 1, (22^ /[a2][^e]+$/ ))>>((\"undefined\"|Infinity)==(-0&&false)))):\r\n;\r\n break;\r\n\r\ncase (c = 1 + c, (((4 + \"foo\")<<(a_2 && (a_2.null+=(4<5))))&&((\"function\"%0)==(Infinity==\"number\")))):\r\n;\r\n break;\r\n\r\ndefault:\r\n;\r\n}\r\n\r\n\r\ncase (a++ + (-a)):\r\n\r\n break;\r\n\r\ncase ((--b) + (-((((\"foo\"||[,0][1])||(a_2 && (a_2[(c = 1 + c, (((-((-1)))<(null*\"object\"))===((false==22)/(([,0].length === 2)!=\"function\"))))]=((-3) + ({})))))||((22 + (-2))!=(4>22)))))):\r\n\r\n/* fall-through */\r\n\r\ncase ((--b) + (-((((3<=2)==(Infinity!=[])) + (~((2*null))))))):\r\n\r\n break;\r\n}}\r\n\r\n{ throw ((--b) + (!((((null>>(-2))&&(null + []))|((null^(-3))!==(2< /[a2][^e]+$/ ))))))}\r\n},\r\n0:(([][([((--b) + ((typeof (a++ + ((typeof b_2 !== \"string\")))))), ][(0 === 1 ? a : b)])])),\r\n}));}} } catch (b_2) { switch (((--b) + (b_2 && b_2[(b_2)]))) { \r\ncase ([((c = c + 1) + (-a)), ((--b) + (b += a)), ((--b) + (({\r\n3:(((c = c + 1) + ((((b_2|=([,0][1]^22))>=(({})&&0x26.toString()))^((null||[])>=(25. ==null)))))),\r\nc:((-((((\"bar\"<<\"bar\")>(([,0].length === 2)>>\"foo\")),((23..toString()<<null)!==(-0||(-3))))))),\r\n})[((--b) + (a_2 && a_2[(void function c_2(){\r\n\r\n\r\n}())]))])), ].c):\r\n((c = c + 1) + ([((--b) + ((typeof a_1 == \"crap\"))), (a++ + ([,0][1])), (a++ + (b /= a)), ((function (){\r\n\r\n{var brake16 = 5; do {var a_1 = (c = 1 + c, (((true&&NaN)!==(25. ===5)) - ((4&&\"object\")<<(0x26.toString()>=false))));} while (((a++ + ( (((c = 1 + c, (c = c + 1, ((1 + Infinity)%((-2)!=3))))) || a || 3).toString() ))) && --brake16 > 0);}\r\n\r\n})()), ((c = c + 1) + (b_2 && b_2.c)), ]));\r\n{}\r\n\r\n break;\r\n\r\ncase ((((1^2)<<(NaN>>\"\"))<(c = c + 1, (0==null)))):\r\n\r\n break;\r\n\r\ncase (4):\r\n{var b_2 = function f0(){\r\n\r\nreturn (a++ + ((1 === 1 ? a : b)?([].null):((--b) + (++b))));\r\n;\r\n\r\n}\r\n(23..toString(), (a++ + (0 === 1 ? a : b)));}\r\n\r\n break;\r\n\r\ncase (true):\r\n{var brake22 = 5; L547281: do {var a;} while ((([((c = c + 1) + (b = a)), ((c = c + 1) + ((((null>>25. )*((-3)^0))===((24 .toString()^Infinity)<<(0!=(-3)))))), (a++ + (-((((4 - [])&&(b_2<<=(NaN!=NaN)))&&((void (23..toString()))>>>((-5)<null)))))), (b = a), ][(1 === 1 ? a : b)])) && --brake22 > 0);}\r\n\r\n break;\r\n}\r\n([(a++ + (22)), ((c = c + 1) + (!a)), ][([(+((((({})<0)^(+((-5))))&((\"object\"|\"number\")^(true>>\"object\"))))), (b++), ].undefined)]);\r\n }\r\n{var a = function f1(undefined, foo_2){\r\n\r\nfunction f2(undefined_2, foo_2){\r\n\r\n{var foo_2 = function f3(c_1){\r\n\r\nfunction f4(foo_2, a, c_1_2){\r\n\r\n;\r\n}\r\nvar b = f4(0, -0);\r\nfunction f5(bar_1, parseInt_1, a_2_2){\r\n\r\n;\r\n}\r\nvar b_2 = f5(\"number\", this, (c = 1 + c, ((((-3)&&25. )!=(22 - (-4)))&&((0!==4) + ((-4)!==\"object\")))));\r\nfunction f6(Math_1, bar_2, NaN_1){\r\n\r\n;\r\n}\r\nvar a = f6((c = 1 + c, (((0x26.toString()>24 .toString())>=(\"object\"===4)) + ((0x26.toString() + (-5))==(-0===(-5))))));\r\nfunction f7(undefined_1){\r\n\r\n;\r\n}\r\nvar b_2_2 = f7((c = 1 + c, ((!(((-5)|\"undefined\")))&&((3!==this)>((-1)===23..toString())))), (c = 1 + c, (((5!=undefined)|(\"\"||3))^(~((5<25. ))))), (-3));\r\nfunction f8(undefined_1){\r\n\r\n;\r\n}\r\nvar b = f8(\"function\", (c = 1 + c, (((23..toString() + ([,0].length === 2))!=(4>>[]))>((c = c + 1, 23..toString())<(false,22)))), (c = 1 + c, ((c = c + 1, (+(\"bar\")))<<(void (((-4)!==-0))))));\r\n\r\n}\r\n(((--b) + (4)));}\r\n{var undefined_1 = function f9(){\r\n\r\n;\r\ntry {(c = 1 + c, ((((-3)*0)&&(c = c + 1, NaN))>((3^\"foo\")!=(NaN + (-2))))); } catch (undefined_2_2) { ; }\r\n\r\n}\r\n(\"object\", (foo_2));}\r\n\r\n}\r\nvar b_2 = f2(22, (-5));\r\n\r\n}\r\n(23..toString(), (-2), \"\");}\r\n\r\nconsole.log(null, a, b, c);\r\n```\r\n```js\r\n// uglified code\r\n//\r\nvar a = 100, b = 10, c = 0;\r\n\r\ntry {\r\n    {\r\n        var expr2 = --b + (--b + -a || a || 3).toString();\r\n        for (var key2 in expr2) {\r\n            c = 1 + c;\r\n            var a_2 = expr2[key2];\r\n            var parseInt_2 = {\r\n                null: --b + (((38..toString() && 23..toString()) ^ (\"foo\" || 22)) < (-2 <= 0) % (-3 << -3)),\r\n                foo: --b + [ {}, a++, (c = c + 1) + a++, a++ + [ function() {\r\n                    c = 1 + c, (38..toString() >= 23..toString()) / (\"\" + 25) <= (0 != \"undefined\") - (true && false);\r\n                    c = 1 + c, delete (parseInt_2 && (parseInt_2.NaN %= \"object\" + 24..toString())) | [ , 0 ][1] !== \"foo\" == \"function\" >> NaN;\r\n                    c = 1 + c, a_2 = (\"undefined\" === 24..toString() || -4 < -0) == ((-0 && \"function\") == (parseInt_2 && (parseInt_2[(c = 1 + c, \r\n                    a_2 && (a_2.undefined = (this >>> 25 ^ \"foo\" / ([ , 0 ].length === 2)) << (c = c + 1, \r\n                    4 - \"undefined\")))] <<= ([ , 0 ].length === 2) >> 24..toString())));\r\n                }, /[abc4]/.test((parseInt_2 && parseInt_2[(c = 1 + c, (\"object\" ^ {} | [ , 0 ].length === 2 ^ 1) / (null / [ , 0 ][1] | (a_2 = 1 | [ , 0 ][1])))] || b || 5).toString()), , (c = c + 1) + [ (c = 1 + c, \r\n                (23..toString() << \"foo\") * (24..toString() >= \"bar\") + (a_2 && (a_2[--b + ((c = 1 + c, \r\n                (a_2 = -undefined * (\"foo\" - 24..toString())) & (23..toString() ^ 24..toString()) == -5 >= -2) ? (c = 1 + c, \r\n                void {} < (23..toString() < -0) > (a_2 && (a_2[(c = 1 + c, (\"\" == \"object\", c = c + 1, \r\n                -4) === (c = c + 1, 23..toString() ^ 3))] = [ , 0 ][1] ^ true)) + (\"bar\" === 4)) : (c = 1 + c, \r\n                parseInt_2 && (parseInt_2.null >>= -1 % 0 == NaN / -1 ^ (parseInt_2 = void Infinity + (-0 == Infinity)))))] = (\"bar\" - -5, \r\n                25 - {})))), (c = 1 + c, (Infinity ^ -0) * (parseInt_2 += 4 && true) === (c = c + 1, \r\n                23..toString()) >> (-0 << 38..toString())), (c = 1 + c, (parseInt_2 = \"number\" + \"object\" !== ([ , 0 ].length === 2 | {})) / ((-2, \r\n                false) === (2 == 23..toString()))) ].null, (c = c + 1) + (b += a) ], (c = c + 1) + [] ][--b + (0 === 1 ? a : b)],\r\n                get null() {\r\n                    {\r\n                        var brake7 = 5;\r\n                        while (a++ + \"object\" && --brake7 > 0) {\r\n                            if (a++ + [ (c = c + 1) + {\r\n                                0: (c = 1 + c, (parseInt_2 && (parseInt_2.null += (a_2 && (a_2[(c = 1 + c, (Infinity | 38..toString(), \r\n                                \"foo\" - this) >= (\"foo\" != -5 || (undefined || 5)))] = (\"number\", /[a2][^e]+$/))) << (c = c + 1, \r\n                                {}))) >= (\"undefined\" >>> 22 === (a_2 = [] - -3))),\r\n                                \"-2\": (c = 1 + c, !(\"\" !== -1 & \"object\" == 22))\r\n                            }.null, [ (c = 1 + c, ((\"\" || [ , 0 ][1]) && (parseInt_2 && (parseInt_2.null += \"bar\" && \"function\"))) > (Infinity >= 38..toString()) % (-5 && -4)), (c = 1 + c, \r\n                            (parseInt_2 += 22 & \"object\") / (a_2 && (a_2[(c = 1 + c, void (([ , 0 ].length === 2) * true) | (parseInt_2 && (parseInt_2[(c = 1 + c, \r\n                            +(22 * this >> (23..toString() < -3)))] = -1 << /[a2][^e]+$/)) > null % -3)] = [] == -4)) <= NaN * 1 - (2 != -0)) ], ++a ]) {\r\n                                switch (--b + NaN) {\r\n                                  default:\r\n                                    for (var brake10 = 5; (c = 1 + c, (\"foo\" <= \"bar\" || this ^ Infinity) == (1 == NaN === ([ , 0 ].length === 2) * \"undefined\")) && brake10 > 0; --brake10) {\r\n                                        c = 1 + c, void ((null <= -0) + (-5 > 22));\r\n                                    }\r\n                                    switch (c = 1 + c, (\"bar\" - 4 ^ 2 << 24..toString()) === ((a_2 && (a_2.foo = [ , 0 ][1] ^ \"foo\")) === NaN * \"number\")) {\r\n                                      case c = 1 + c, -(\"number\" >> \"\") << ([ , 0 ][1] != this ^ [ , 0 ][1] * \"bar\"):\r\n                                        ;\r\n                                        break;\r\n\r\n                                      case c = 1 + c, (c = c + 1, 22 ^ /[a2][^e]+$/) >> ((\"undefined\" | Infinity) == (-0 && false)):\r\n                                        ;\r\n                                        break;\r\n\r\n                                      case c = 1 + c, 4 + \"foo\" << (a_2 && (a_2.null += 4 < 5)) && \"function\" % 0 == (Infinity == \"number\"):\r\n                                        ;\r\n                                        break;\r\n\r\n                                      default:\r\n                                        ;\r\n                                    }\r\n\r\n                                  case a++ + -a:\r\n                                    break;\r\n\r\n                                  case --b + -(\"foo\" || [ , 0 ][1] || a_2 && (a_2[(c = 1 + c, - -1 < null * \"object\" === (false == 22) / ([ , 0 ].length === 2 != \"function\"))] = -3 + {}) || 22 + -2 != 4 > 22):\r\n                                  case --b + -((3 <= 2 == (Infinity != [])) + ~(2 * null)):\r\n                                    break;\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                    {\r\n                        throw --b + !((null >> -2 && null + []) | (null ^ -3) !== 2 < /[a2][^e]+$/);\r\n                    }\r\n                },\r\n                0: [][[ --b + typeof (a++ + (typeof b_2 !== \"string\")) ][0 === 1 ? a : b]]\r\n            };\r\n        }\r\n    }\r\n} catch (b_2) {\r\n    switch (--b + (b_2 && b_2[b_2])) {\r\n      case [ (c = c + 1) + -a, --b + (b += a), --b + {\r\n            3: (c = c + 1) + ((b_2 |= [ , 0 ][1] ^ 22) >= ({} && 38..toString()) ^ (null || []) >= (25 == null)),\r\n            c: -(\"bar\" << \"bar\" > ([ , 0 ].length === 2) >> \"foo\", 23..toString() << null !== (-0 || -3))\r\n        }[--b + (a_2 && a_2[void function c_2() {}()])] ].c:\r\n        (c = c + 1) + [ --b + (typeof a_1 == \"crap\"), a++ + [ , 0 ][1], a++ + (b /= a), function() {\r\n            {\r\n                var brake16 = 5;\r\n                do {\r\n                    var a_1 = (c = 1 + c, ((true && NaN) !== (25 === 5)) - ((4 && \"object\") << (38..toString() >= false)));\r\n                } while (a++ + ((c = 1 + c, c = c + 1, (1 + Infinity) % (-2 != 3)) || a || 3).toString() && --brake16 > 0);\r\n            }\r\n        }(), (c = c + 1) + (b_2 && b_2.c) ];\r\n        {}\r\n        break;\r\n\r\n      case (1 ^ 2) << (NaN >> \"\") < (c = c + 1, 0 == null):\r\n        break;\r\n\r\n      case 4:\r\n        {\r\n            var b_2 = function f0() {\r\n                return a++ + ((1 === 1 ? a : b) ? [].null : --b + ++b);\r\n            }(23..toString(), a++ + (0 === 1 ? a : b));\r\n        }\r\n        break;\r\n\r\n      case true:\r\n        {\r\n            var brake22 = 5;\r\n            L547281: do {\r\n                var a;\r\n            } while ([ (c = c + 1) + (b = a), (c = c + 1) + ((null >> 25) * (-3 ^ 0) === (24..toString() ^ Infinity) << (0 != -3)), a++ + -(4 - [] && (b_2 <<= NaN != NaN) && void 23..toString() >>> (-5 < null)), b = a ][1 === 1 ? a : b] && --brake22 > 0);\r\n        }\r\n        break;\r\n    }\r\n    [ a++ + 22, (c = c + 1) + !a ][[ +(({} < 0 ^ + -5) & ((\"object\" | \"number\") ^ true >> \"object\")), b++ ].undefined];\r\n}\r\n\r\n{\r\n    var a = function f1(undefined, foo_2) {\r\n        function f2(undefined_2, foo_2) {\r\n            {\r\n                var foo_2 = function f3(c_1) {\r\n                    function f4(foo_2, a, c_1_2) {\r\n                    }\r\n                    var b = f4(0, -0);\r\n                    function f5(bar_1, parseInt_1, a_2_2) {\r\n                    }\r\n                    var b_2 = f5(\"number\", this, (c = 1 + c, (-3 && 25) != 22 - -4 && (0 !== 4) + (-4 !== \"object\")));\r\n                    function f6(Math_1, bar_2, NaN_1) {\r\n                    }\r\n                    var a = f6((c = 1 + c, (38..toString() > 24..toString() >= (\"object\" === 4)) + (38..toString() + -5 == (-0 === -5))));\r\n                    function f7(undefined_1) {\r\n                    }\r\n                    var b_2_2 = f7((c = 1 + c, !(-5 | \"undefined\") && (3 !== this) > (-1 === 23..toString())), (c = 1 + c, \r\n                    (5 != undefined | (\"\" || 3)) ^ ~(5 < 25)), -3);\r\n                    function f8(undefined_1) {\r\n                    }\r\n                    var b = f8(\"function\", (c = 1 + c, (23..toString() + ([ , 0 ].length === 2) != 4 >> []) > ((c = c + 1, \r\n                    23..toString()) < (false, 22))), (c = 1 + c, (c = c + 1, +\"bar\") << void (-4 !== -0)));\r\n                }(--b + 4);\r\n            }\r\n            {\r\n                var undefined_1 = function f9() {\r\n                    try {\r\n                        c = 1 + c, (-3 * 0 && (c = c + 1, NaN)) > ((3 ^ \"foo\") != NaN + -2);\r\n                    } catch (undefined_2_2) {\r\n                    }\r\n                }(\"object\", foo_2);\r\n            }\r\n        }\r\n        var b_2 = f2(22, -5);\r\n    }(23..toString(), -2, \"\");\r\n}\r\n\r\nconsole.log(null, a, b, c);\r\n```\r\n```js\r\noriginal result:\r\nnull undefined 7762 7585\r\n\r\nuglified result:\r\nnull undefined 7760 7583\r\n\r\nminify(options):\r\n{\r\n  \"compress\": false,\r\n  \"mangle\": false,\r\n  \"output\": {\r\n    \"beautify\": true,\r\n    \"bracketize\": true\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"alexlamsl"}}