diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-19 02:55:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-19 02:55:43 +0800 |
commit | b55a2fd53113d70900c7cd96ad8cfdcc235629c2 (patch) | |
tree | a251bbf35f87daf3fc0da63e3cf0afdb0c8a15fb /test/compress | |
parent | e8a2c0b5bf18659a3e1285b6038ea755a290220d (diff) | |
download | tracifyjs-b55a2fd53113d70900c7cd96ad8cfdcc235629c2.tar.gz tracifyjs-b55a2fd53113d70900c7cd96ad8cfdcc235629c2.zip |
fix corner case in `functions` (#3367)
fixes #3366
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/functions.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index c43c17eb..7303b91b 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -2981,3 +2981,34 @@ issue_3364: { } expect_stdout: "2" } + +issue_3366: { + options = { + functions: true, + inline: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f() { + function g() { + return function() {}; + } + var a = g(); + (function() { + this && a && console.log("PASS"); + })(); + } + f(); + } + expect: { + (function() { + function a() {} + (function() { + this && a && console.log("PASS"); + })(); + })(); + } + expect_stdout: "PASS" +} |