diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-30 15:20:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-30 15:20:25 +0800 |
commit | ed7a0a454e9c06c592a0dd40ea740faadc0bb4c0 (patch) | |
tree | af94027f118e16290386863cb1aeaf72bd1fa3ff /test | |
parent | d819559a01fca28921a9b93cb1f4127b6ea3306b (diff) | |
download | tracifyjs-ed7a0a454e9c06c592a0dd40ea740faadc0bb4c0.tar.gz tracifyjs-ed7a0a454e9c06c592a0dd40ea740faadc0bb4c0.zip |
fix `dead_code` on escaped `return` assignment (#2693)
fixes #2692
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/dead-code.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index 7ea380d2..68ee4b12 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -855,3 +855,29 @@ issue_2666: { } expect_stdout: "object" } + +issue_2692: { + options = { + dead_code: true, + reduce_vars: false, + } + input: { + function f(a) { + return a = g; + function g() { + return a; + } + } + console.log(typeof f()()); + } + expect: { + function f(a) { + return a = g; + function g() { + return a; + } + } + console.log(typeof f()()); + } + expect_stdout: "function" +} |