diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-26 19:14:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-26 19:14:30 +0800 |
commit | 861a79ac9fdb2cdbb54054306eb896e2c134af73 (patch) | |
tree | 45fab27f3d43aad6001f02803ac008c74fc8e11f /test/compress/reduce_vars.js | |
parent | 00996afd2ce1f05fa973016e793495f69b524d5b (diff) | |
download | tracifyjs-861a79ac9fdb2cdbb54054306eb896e2c134af73.tar.gz tracifyjs-861a79ac9fdb2cdbb54054306eb896e2c134af73.zip |
fix `delete` related issues in `collapse_vars` and `reduce_vars` (#1689)
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r-- | test/compress/reduce_vars.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 943dd290..f4dd68d2 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -1544,3 +1544,30 @@ issue_1670_6: { } expect_stdout: "1" } + +unary_delete: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + var b = 10; + function f() { + var a; + if (delete a) b--; + } + f(); + console.log(b); + } + expect: { + var b = 10; + function f() { + var a; + if (delete a) b--; + } + f(); + console.log(b); + } + expect_stdout: true +} |