From 323bc47dbf6830a6e5d185bb6cc9c92abd007b3f Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 10 Jan 2018 16:23:29 +0800 Subject: [PATCH] skip only `var`s in `if_return` fixes 2747 --- lib/compress.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index 406a331c..2a6ca1f5 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; } }