diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-03-13 17:35:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 17:35:34 +0800 |
commit | 5429234138b1645d0c06de48c60e3c5469a81daf (patch) | |
tree | 55732a276f8ba97e3b4d8b1acfbbddb513c33823 /test | |
parent | b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0 (diff) | |
download | tracifyjs-5429234138b1645d0c06de48c60e3c5469a81daf.tar.gz tracifyjs-5429234138b1645d0c06de48c60e3c5469a81daf.zip |
preserve non-constant value assignments with modifications (#2997)
fixes #2995
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/drop-unused.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index ee8e6c0c..301bff1c 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1785,3 +1785,32 @@ issue_805_2: { "bar", ] } + +issue_2995: { + options = { + pure_getters: "strict", + reduce_vars: true, + unused: true, + } + input: { + function f(a) { + var b; + a.b = b = function() {}; + b.c = "PASS"; + } + var o = {}; + f(o); + console.log(o.b.c); + } + expect: { + function f(a) { + var b; + a.b = b = function() {}; + b.c = "PASS"; + } + var o = {}; + f(o); + console.log(o.b.c); + } + expect_stdout: "PASS" +} |