aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-05-24 04:46:58 +0100
committerGitHub <noreply@github.com>2021-05-24 11:46:58 +0800
commit1e787c556b916644e8ba2fc36fce024001f00ff8 (patch)
tree31ac8c02d19f77720d10c1b1bc9dbd3957aa6514 /test/compress
parentdf47632eccdc505810073d7bfced21bbf8c2dd98 (diff)
downloadtracifyjs-1e787c556b916644e8ba2fc36fce024001f00ff8.tar.gz
tracifyjs-1e787c556b916644e8ba2fc36fce024001f00ff8.zip
fix corner case in `mangle` (#4961)
fixes #4960
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/const.js30
1 files changed, 30 insertions, 0 deletions
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"
+}