aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-19 01:33:57 +0000
committerGitHub <noreply@github.com>2021-01-19 09:33:57 +0800
commit90ec46824063450d88e04235df276a89e7025b77 (patch)
treeefe23fbe1a8b249abe28f358a8758fb9c5a3c0c1 /test
parent994293e97229110f676dc72ad68b6b2d8a015394 (diff)
downloadtracifyjs-90ec46824063450d88e04235df276a89e7025b77.tar.gz
tracifyjs-90ec46824063450d88e04235df276a89e7025b77.zip
fix corner case in `dead_code` (#4571)
fixes #4570
Diffstat (limited to 'test')
-rw-r--r--test/compress/dead-code.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index cfbc6fae..1720a0dc 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1399,3 +1399,21 @@ issue_4366: {
expect_stdout: "PASS"
node_version: ">=4"
}
+
+issue_4570: {
+ options = {
+ dead_code: true,
+ inline: true,
+ }
+ input: {
+ var a = function(b) {
+ return a += b;
+ }() ? 0 : a;
+ console.log(a);
+ }
+ expect: {
+ var a = (a += void 0) ? 0 : a;
+ console.log(a);
+ }
+ expect_stdout: "NaN"
+}