diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-27 07:40:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-27 07:40:34 +0800 |
commit | f30790b11bb9e162a19d7769ab54d8bb3f61cc27 (patch) | |
tree | 8d247107c9e87383d189aececce75b980c9e7fc4 /test | |
parent | 5205dbcbf4f522f8b4dc9f9f9727b621982c9f28 (diff) | |
download | tracifyjs-f30790b11bb9e162a19d7769ab54d8bb3f61cc27.tar.gz tracifyjs-f30790b11bb9e162a19d7769ab54d8bb3f61cc27.zip |
fix `dead_code` on `return` assignments (#2668)
fixes #2666
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/dead-code.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index 591dd3a9..7ea380d2 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -828,3 +828,30 @@ issue_2597: { } expect_stdout: "PASS" } + +issue_2666: { + options = { + dead_code: true, + } + input: { + function f(a) { + return a = { + p: function() { + return a; + } + }; + } + console.log(typeof f().p()); + } + expect: { + function f(a) { + return a = { + p: function() { + return a; + } + }; + } + console.log(typeof f().p()); + } + expect_stdout: "object" +} |