aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-08-29 01:10:04 +0800
committerGitHub <noreply@github.com>2017-08-29 01:10:04 +0800
commite5cf7972eab25581f9aa020bc8dbdd8bf25743cb (patch)
tree8f432a66a483ddbedfab83fcefbe82ed5f3d70bb /test/compress/drop-unused.js
parentf81ff10a9b9b3f65ad78bde5b2dbbc5739c70529 (diff)
downloadtracifyjs-e5cf7972eab25581f9aa020bc8dbdd8bf25743cb.tar.gz
tracifyjs-e5cf7972eab25581f9aa020bc8dbdd8bf25743cb.zip
fix `unused` patching of `AST_For.init` blocks (#2289)
fixes #2288
Diffstat (limited to 'test/compress/drop-unused.js')
-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 34d47d0d..c9048540 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1239,3 +1239,25 @@ issue_2226_3: {
}
expect_stdout: "3"
}
+
+issue_2288: {
+ options = {
+ unused: true,
+ }
+ beautify = {
+ beautify: true,
+ }
+ input: {
+ function foo(o) {
+ for (var j = o.a, i = 0; i < 0; i++);
+ for (var i = 0; i < 0; i++);
+ }
+ }
+ expect: {
+ function foo(o) {
+ o.a;
+ for (i = 0; i < 0; i++);
+ for (var i = 0; i < 0; i++);
+ }
+ }
+}