aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-20 04:18:38 +0800
committerGitHub <noreply@github.com>2017-04-20 04:18:38 +0800
commit88e7a542cd8a8406f54c53cefe72944452f5e013 (patch)
tree6f151532639bbaee59c0f3cfa33c13bb0ba3df2f /test/compress
parent4dcff038cb1a6951a0b20d1345bfdb27d756301c (diff)
downloadtracifyjs-88e7a542cd8a8406f54c53cefe72944452f5e013.tar.gz
tracifyjs-88e7a542cd8a8406f54c53cefe72944452f5e013.zip
fix `unused` on labeled for-loop (#1831)
fixes #1830
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/drop-unused.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 2eefbe8d..8f0aa0bf 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1056,3 +1056,38 @@ drop_var: {
"3 2",
]
}
+
+issue_1830_1: {
+ options = {
+ unused: true,
+ }
+ input: {
+ !function() {
+ L: for (var b = console.log(1); !1;) continue L;
+ }();
+ }
+ expect: {
+ !function() {
+ L: for (console.log(1); !1;) continue L;
+ }();
+ }
+ expect_stdout: "1"
+}
+
+issue_1830_2: {
+ options = {
+ unused: true,
+ }
+ input: {
+ !function() {
+ L: for (var a = 1, b = console.log(a); --a;) continue L;
+ }();
+ }
+ expect: {
+ !function() {
+ var a = 1;
+ L: for (console.log(a); --a;) continue L;
+ }();
+ }
+ expect_stdout: "1"
+}