diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-07-31 01:05:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 08:05:09 +0800 |
commit | ee632a5519078ac3fe97d0864731bea4bdad9365 (patch) | |
tree | e6b8469bcec072d98849c2dca8ce3545011db2db /test/compress | |
parent | dfe47bcc42d0385577ecffa7fe312025e1369e7b (diff) | |
download | tracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.tar.gz tracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.zip |
fix corner case in `reduce_vars` (#4031)
fixes #4030
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/reduce_vars.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 9010fb1e..85969f90 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -7383,3 +7383,26 @@ issue_3974: { } expect_stdout: "PASS" } + +issue_4030: { + options = { + collapse_vars: true, + evaluate: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var a; + { + delete (a = "PASS"); + A = "PASS"; + } + console.log(A); + } + expect: { + A = "PASS"; + console.log("PASS"); + } + expect_stdout: "PASS" +} |