From: Alex Lam S.L Date: Wed, 10 Jan 2018 11:08:46 +0000 (+0800) Subject: skip only `var`s in `if_return` (#2759) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6a0af85c8bf8673498e89ad7226d6e8cc80b2c15;p=UglifyJS.git skip only `var`s in `if_return` (#2759) fixes #2747 --- diff --git a/lib/compress.js b/lib/compress.js index 9760c546..3e7269d0 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1523,7 +1523,7 @@ merge(Compressor.prototype, { function next_index(i) { for (var j = i + 1, len = statements.length; j < len; j++) { var stat = statements[j]; - if (!(stat instanceof AST_Definitions && declarations_only(stat))) { + if (!(stat instanceof AST_Var && declarations_only(stat))) { break; } } @@ -1533,7 +1533,7 @@ merge(Compressor.prototype, { function prev_index(i) { for (var j = i; --j >= 0;) { var stat = statements[j]; - if (!(stat instanceof AST_Definitions && declarations_only(stat))) { + if (!(stat instanceof AST_Var && declarations_only(stat))) { break; } }