aboutsummaryrefslogtreecommitdiff
path: root/test/compress/loops.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-04-21 02:16:05 +0800
committerGitHub <noreply@github.com>2019-04-21 02:16:05 +0800
commitc719552317a4ec14b04226cc0440d25b4028f09c (patch)
treefb68ca3051fb5d475b68ebd0fa7912fd820036cd /test/compress/loops.js
parent855964a87a14308ae97eea35171982fb33bd58ca (diff)
downloadtracifyjs-c719552317a4ec14b04226cc0440d25b4028f09c.tar.gz
tracifyjs-c719552317a4ec14b04226cc0440d25b4028f09c.zip
fix corner cases in `functions` (#3372)
fixes #3371
Diffstat (limited to 'test/compress/loops.js')
-rw-r--r--test/compress/loops.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index 3fa78338..137fd9da 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -646,3 +646,30 @@ issue_2904: {
}
expect_stdout: "1"
}
+
+issue_3371: {
+ options = {
+ functions: true,
+ join_vars: true,
+ loops: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var a = function() {
+ console.log("PASS");
+ };
+ while (a());
+ })();
+ }
+ expect: {
+ (function() {
+ function a() {
+ console.log("PASS");
+ }
+ for (; a(); );
+ })();
+ }
+ expect_stdout: "PASS"
+}