skip only vars in if_return (#2759)

fixes #2747
This commit is contained in:
Alex Lam S.L
2018-01-10 19:08:46 +08:00
committed by GitHub
parent 09269be974
commit 6a0af85c8b

View File

@@ -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;
}
}