From 9f8106e1d845f66033c3c73e2e3844cf32fd4bb2 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 14 Oct 2020 00:18:26 +0100 Subject: fix corner case in `collapse_vars` (#4217) fixes #4216 --- test/compress/const.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/compress/const.js b/test/compress/const.js index 4411cbf8..27c55ddb 100644 --- a/test/compress/const.js +++ b/test/compress/const.js @@ -1009,3 +1009,26 @@ issue_4212_2: { } expect_stdout: true } + +issue_4216: { + options = { + collapse_vars: true, + conditionals: true, + dead_code: true, + evaluate: true, + } + input: { + if (a = 0) { + const a = 0; + } + console.log(typeof a); + } + expect: { + a = 0; + { + const a = void 0; + } + console.log(typeof a); + } + expect_stdout: true +} -- cgit v1.2.3