aboutsummaryrefslogtreecommitdiff
path: root/test/compress/labels.js
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2018-07-01 14:34:42 +0800
committeralexlamsl <alexlamsl@gmail.com>2018-07-01 14:34:42 +0800
commit5ffc17d4aa36c40a4d5ebe558edbc734b45ca1dc (patch)
tree12f66c5bbd9b93a5f468cfad7349acea0900df28 /test/compress/labels.js
parent6aa750010f23acdc24078a5d7e66cef009cbf570 (diff)
downloadtracifyjs-5ffc17d4aa36c40a4d5ebe558edbc734b45ca1dc.tar.gz
tracifyjs-5ffc17d4aa36c40a4d5ebe558edbc734b45ca1dc.zip
fix corner case in `unused`
Diffstat (limited to 'test/compress/labels.js')
-rw-r--r--test/compress/labels.js54
1 files changed, 45 insertions, 9 deletions
diff --git a/test/compress/labels.js b/test/compress/labels.js
index 0d85d10a..00232834 100644
--- a/test/compress/labels.js
+++ b/test/compress/labels.js
@@ -1,5 +1,9 @@
labels_1: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
out: {
if (foo) break out;
@@ -13,7 +17,11 @@ labels_1: {
}
labels_2: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
out: {
if (foo) print("stuff");
@@ -30,7 +38,11 @@ labels_2: {
}
labels_3: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
for (var i = 0; i < 5; ++i) {
if (i < 3) continue;
@@ -45,7 +57,11 @@ labels_3: {
}
labels_4: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
out: for (var i = 0; i < 5; ++i) {
if (i < 3) continue out;
@@ -60,7 +76,11 @@ labels_4: {
}
labels_5: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
// should keep the break-s in the following
input: {
while (foo) {
@@ -92,7 +112,11 @@ labels_6: {
}
labels_7: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
while (foo) {
x();
@@ -109,7 +133,11 @@ labels_7: {
}
labels_8: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
while (foo) {
x();
@@ -127,7 +155,11 @@ labels_8: {
}
labels_9: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
out: while (foo) {
x();
@@ -146,7 +178,11 @@ labels_9: {
}
labels_10: {
- options = { if_return: true, conditionals: true, dead_code: true };
+ options = {
+ conditionals: true,
+ dead_code: true,
+ if_return: true,
+ }
input: {
out: while (foo) {
x();