aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-28 13:07:36 +0100
committerGitHub <noreply@github.com>2020-05-28 20:07:36 +0800
commitd47ea77811c5b5935578e29203db99739683f5f5 (patch)
tree5b5fd796ddf8b54f765e731c9446cefacad88063 /test/compress/functions.js
parent7840746bd95c965409ba7e6dbbd291a88ed64f83 (diff)
downloadtracifyjs-d47ea77811c5b5935578e29203db99739683f5f5.tar.gz
tracifyjs-d47ea77811c5b5935578e29203db99739683f5f5.zip
fix corner case in `functions` (#3930)
fixes #3929
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 7ad6ff03..9607c593 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -4705,3 +4705,44 @@ issue_3911: {
}
expect_stdout: "PASS"
}
+
+issue_3929: {
+ options = {
+ functions: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var abc = function f() {
+ (function() {
+ switch (f) {
+ default:
+ var abc = 0;
+ case 0:
+ abc.p;
+ }
+ console.log(typeof f);
+ })();
+ };
+ typeof abc && abc();
+ })();
+ }
+ expect: {
+ (function() {
+ var abc = function f() {
+ (function() {
+ switch (f) {
+ default:
+ var abc = 0;
+ case 0:
+ abc.p;
+ }
+ console.log(typeof f);
+ })();
+ };
+ typeof abc && abc();
+ })();
+ }
+ expect_stdout: "function"
+}