diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-18 03:00:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 03:00:05 +0800 |
commit | b29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79 (patch) | |
tree | 0852628060e5cfcf77ff223c6e2d0094f8a3b1ba /test | |
parent | 5de369fa67059efe694700513b66bf473fd98e06 (diff) | |
download | tracifyjs-b29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79.tar.gz tracifyjs-b29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79.zip |
improve transversal efficiency in `collapse_vars` (#2611)
fixes #2603
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/collapse_vars.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 1a487981..9a20c559 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -3990,3 +3990,25 @@ cascade_call: { } } } + +replace_all_var: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var a = "PASS"; + (function() { + var b = b || c && c[a = "FAIL"], c = a; + })(); + console.log(a); + } + expect: { + var a = "PASS"; + (function() { + var b = b || c && c[a = "FAIL"], c = a; + })(); + console.log(a); + } + expect_stdout: "PASS" +} |