aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-26 08:31:33 +0100
committerGitHub <noreply@github.com>2020-09-26 15:31:33 +0800
commitb4ff6d0f2da3f094cf1bb4897a2dc67ad4f3efa5 (patch)
treea4ac8b3aed1a702275516c41e93aae1fb5969e8b /test/compress/functions.js
parent9882a9f4af95af4b0cba0a4a60a695ba2f6de04d (diff)
downloadtracifyjs-b4ff6d0f2da3f094cf1bb4897a2dc67ad4f3efa5.tar.gz
tracifyjs-b4ff6d0f2da3f094cf1bb4897a2dc67ad4f3efa5.zip
fix corner cases in `functions` & `merge_vars` (#4156)
fixes #4155
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 3027d59e..1be01167 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -4777,3 +4777,34 @@ issue_4006: {
}
expect_stdout: "-1"
}
+
+issue_4155: {
+ options = {
+ functions: true,
+ inline: true,
+ merge_vars: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var a;
+ (function() {
+ console.log(a);
+ })(a);
+ var b = function() {};
+ b && console.log(typeof b);
+ })();
+ }
+ expect: {
+ (function() {
+ void console.log(b);
+ var b = function() {};
+ b && console.log(typeof b);
+ })();
+ }
+ expect_stdout: [
+ "undefined",
+ "function",
+ ]
+}