From 862b1b77b5215dce8b4b3ff7a266e4083554869a Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 11 Mar 2021 01:16:16 +0000 Subject: fix corner cases in `merge_vars` & with `exports` (#4762) fixes #4761 --- test/compress/merge_vars.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/compress/merge_vars.js') diff --git a/test/compress/merge_vars.js b/test/compress/merge_vars.js index a26c0dd8..0494acfb 100644 --- a/test/compress/merge_vars.js +++ b/test/compress/merge_vars.js @@ -3281,3 +3281,23 @@ issue_4759: { } expect_stdout: "undefined" } + +issue_4761: { + options = { + merge_vars: true, + toplevel: true, + } + input: { + var a = "FAIL", b; + try { + !a && --a && (b = 0)[console] || console.log(b); + } catch (e) {} + } + expect: { + var a = "FAIL", b; + try { + !a && --a && (b = 0)[console] || console.log(b); + } catch (e) {} + } + expect_stdout: "undefined" +} -- cgit v1.2.3