aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-23 01:51:56 +0800
committerGitHub <noreply@github.com>2017-04-23 01:51:56 +0800
commit45ce3694807ee0daeb7e0f84c12ffbd8ca4f733c (patch)
tree7acd82d0f499a80dd2f75e3291c4abf13aed8c34 /test
parentca32a09032b3e7d6aac1f0b01f67a0b67b3037f1 (diff)
downloadtracifyjs-45ce3694807ee0daeb7e0f84c12ffbd8ca4f733c.tar.gz
tracifyjs-45ce3694807ee0daeb7e0f84c12ffbd8ca4f733c.zip
fix `AST_For.init` patch-up in `drop_unused()` (#1839)
fixes #1838
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-unused.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 7456f676..c702cfaf 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1092,3 +1092,25 @@ issue_1830_2: {
}
expect_stdout: "1"
}
+
+issue_1838: {
+ options = {
+ join_vars: true,
+ loops: true,
+ unused: true,
+ }
+ beautify = {
+ beautify: true,
+ }
+ input: {
+ function f() {
+ var b = a;
+ while (c);
+ }
+ }
+ expect_exact: [
+ "function f() {",
+ " for (a; c; ) ;",
+ "}",
+ ]
+}