From eb7fa252703c052f81e2ab491d84ba352648e4c9 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 12 May 2020 10:58:37 +0100 Subject: fix corner case in `evaluate` (#3888) fixes #3887 --- test/compress/evaluate.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/compress/evaluate.js') diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 60f059a8..8425abe2 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -2395,3 +2395,26 @@ issue_3882: { "NaN", ] } + +issue_3887: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + (function(b) { + try { + b-- && console.log("PASS"); + } catch (a_2) {} + })(1); + } + expect: { + (function(b) { + try { + b-- && console.log("PASS"); + } catch (a_2) {} + })(1); + } + expect_stdout: "PASS" +} -- cgit v1.2.3