aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-04-22 22:27:26 +0100
committerGitHub <noreply@github.com>2020-04-23 05:27:26 +0800
commit3ae24329eb29c9b1c924c16778348e7ae7efc510 (patch)
tree4fd522c298a35e5d1af6ae51c367990abc4d8d62 /test
parent01b13d797cdeabecad25c33e039fd3ec848b71d0 (diff)
downloadtracifyjs-3ae24329eb29c9b1c924c16778348e7ae7efc510.tar.gz
tracifyjs-3ae24329eb29c9b1c924c16778348e7ae7efc510.zip
gate various label-related transformations (#3812)
Diffstat (limited to 'test')
-rw-r--r--test/compress/labels.js7
-rw-r--r--test/compress/loops.js6
-rw-r--r--test/compress/transform.js1
3 files changed, 14 insertions, 0 deletions
diff --git a/test/compress/labels.js b/test/compress/labels.js
index 00232834..13ac8e38 100644
--- a/test/compress/labels.js
+++ b/test/compress/labels.js
@@ -3,6 +3,7 @@ labels_1: {
conditionals: true,
dead_code: true,
if_return: true,
+ unused: true,
}
input: {
out: {
@@ -21,6 +22,7 @@ labels_2: {
conditionals: true,
dead_code: true,
if_return: true,
+ unused: true,
}
input: {
out: {
@@ -61,6 +63,7 @@ labels_4: {
conditionals: true,
dead_code: true,
if_return: true,
+ unused: true,
}
input: {
out: for (var i = 0; i < 5; ++i) {
@@ -105,6 +108,9 @@ labels_5: {
}
labels_6: {
+ options = {
+ dead_code: true,
+ }
input: {
out: break out;
};
@@ -159,6 +165,7 @@ labels_9: {
conditionals: true,
dead_code: true,
if_return: true,
+ unused: true,
}
input: {
out: while (foo) {
diff --git a/test/compress/loops.js b/test/compress/loops.js
index 44874479..aef1b90b 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -549,6 +549,7 @@ issue_2740_2: {
dead_code: true,
loops: true,
passes: 2,
+ unused: true,
}
input: {
L1: while (x()) {
@@ -564,6 +565,7 @@ issue_2740_3: {
options = {
dead_code: true,
loops: true,
+ unused: true,
}
input: {
L1: for (var x = 0; x < 3; x++) {
@@ -589,6 +591,7 @@ issue_2740_4: {
dead_code: true,
loops: true,
passes: 2,
+ unused: true,
}
input: {
L1: for (var x = 0; x < 3; x++) {
@@ -613,6 +616,7 @@ issue_2740_5: {
dead_code: true,
loops: true,
passes: 2,
+ unused: true,
}
input: {
L1: for (var x = 0; x < 3; x++) {
@@ -763,6 +767,7 @@ issue_3631_1: {
loops: true,
reduce_vars: true,
toplevel: true,
+ unused: true,
}
input: {
var c = 0;
@@ -789,6 +794,7 @@ issue_3631_2: {
loops: true,
reduce_vars: true,
toplevel: true,
+ unused: true,
}
input: {
L: for (var a = 1; a--; console.log(b)) {
diff --git a/test/compress/transform.js b/test/compress/transform.js
index 66f19bd1..d8e1ee79 100644
--- a/test/compress/transform.js
+++ b/test/compress/transform.js
@@ -69,6 +69,7 @@ label_if_break: {
dead_code: true,
evaluate: true,
side_effects: true,
+ unused: true,
}
input: {
L: if (true) {