From 1e787c556b916644e8ba2fc36fce024001f00ff8 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 24 May 2021 04:46:58 +0100 Subject: fix corner case in `mangle` (#4961) fixes #4960 --- test/compress/const.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/compress') diff --git a/test/compress/const.js b/test/compress/const.js index d7731005..58c1a304 100644 --- a/test/compress/const.js +++ b/test/compress/const.js @@ -1588,3 +1588,33 @@ issue_4954_2: { expect_stdout: "PASS" node_version: ">=4" } + +issue_4960: { + mangle = {} + input: { + "use strict"; + var a; + (function() { + { + const a = console.log("PASS"); + } + try {} catch (e) { + const a = console.log("FAIL"); + } + })(); + } + expect: { + "use strict"; + var a; + (function() { + { + const o = console.log("PASS"); + } + try {} catch (c) { + const o = console.log("FAIL"); + } + })(); + } + expect_stdout: "PASS" + node_version: ">=4" +} -- cgit v1.2.3