diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-11-12 05:16:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-12 05:16:14 +0800 |
commit | 5b20bad4b360dc58d66be0143d739ac3cfad9bfe (patch) | |
tree | 35e47df71aeabd482e000ecf6cc3203b417e3ecb /test/compress/dead-code.js | |
parent | 765a06340fa7e9779701d1f9941c45fa5c8be819 (diff) | |
download | tracifyjs-5b20bad4b360dc58d66be0143d739ac3cfad9bfe.tar.gz tracifyjs-5b20bad4b360dc58d66be0143d739ac3cfad9bfe.zip |
fix corner case in `dead_code` (#3579)
fixes #3578
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r-- | test/compress/dead-code.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index abc7384d..d4832c73 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -1102,3 +1102,30 @@ catch_return_assign: { } expect_stdout: "PASS" } + +issue_3578: { + options = { + dead_code: true, + } + input: { + var a = "FAIL", b, c; + try { + b = c.p = b = 0; + } catch (e) { + b += 42; + b && (a = "PASS"); + } + console.log(a); + } + expect: { + var a = "FAIL", b, c; + try { + b = c.p = b = 0; + } catch (e) { + b += 42; + b && (a = "PASS"); + } + console.log(a); + } + expect_stdout: "PASS" +} |