aboutsummaryrefslogtreecommitdiff
path: root/test/compress/loops.js
diff options
context:
space:
mode:
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"
+}