From 0a65de89b97731cd83a077303dd0511ba7ff7151 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 25 Mar 2017 21:17:30 +0800 Subject: fix `reduce_vars` on `AST_Switch` (#1671) Take conditional nature of switch branches into account. fixes #1670 --- lib/compress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/compress.js') diff --git a/lib/compress.js b/lib/compress.js index e12c5eb0..bea9c9a4 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -341,7 +341,7 @@ merge(Compressor.prototype, { pop(); return true; } - if (node instanceof AST_Catch) { + if (node instanceof AST_Catch || node instanceof AST_SwitchBranch) { push(); descend(); pop(); -- cgit v1.2.3