aboutsummaryrefslogtreecommitdiff
path: root/test/compress/labels.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-27 05:32:18 +0000
committerGitHub <noreply@github.com>2020-12-27 13:32:18 +0800
commita8785fb6943e9cf8e370e19f29945e544b3be4b2 (patch)
treef3bd80c716943b98345ba885c6c34795b61ac6cd /test/compress/labels.js
parentdd6d7b3d88072bebdd21fedc10abd6e04ff7d094 (diff)
downloadtracifyjs-a8785fb6943e9cf8e370e19f29945e544b3be4b2.tar.gz
tracifyjs-a8785fb6943e9cf8e370e19f29945e544b3be4b2.zip
workaround v8 bug with labels (#4467)
closes #4466
Diffstat (limited to 'test/compress/labels.js')
-rw-r--r--test/compress/labels.js120
1 files changed, 120 insertions, 0 deletions
diff --git a/test/compress/labels.js b/test/compress/labels.js
index 13ac8e38..6b7c5a3d 100644
--- a/test/compress/labels.js
+++ b/test/compress/labels.js
@@ -207,3 +207,123 @@ labels_10: {
}
}
}
+
+issue_4466_1: {
+ mangle = {
+ v8: false,
+ }
+ input: {
+ A: if (console.log("PASS"))
+ B:;
+ else
+ C:;
+ }
+ expect: {
+ e: if (console.log("PASS"))
+ l:;
+ else
+ l:;
+ }
+ expect_stdout: "PASS"
+ node_version: ">=12"
+}
+
+issue_4466_1_v8: {
+ mangle = {
+ v8: true,
+ }
+ input: {
+ A: if (console.log("PASS"))
+ B:;
+ else
+ C:;
+ }
+ expect: {
+ e: if (console.log("PASS"))
+ l:;
+ else
+ o:;
+ }
+ expect_stdout: "PASS"
+ node_version: ">=12"
+}
+
+issue_4466_2: {
+ mangle = {
+ toplevel: false,
+ v8: false,
+ }
+ input: {
+ if (console.log("PASS"))
+ A:;
+ else
+ B:;
+ }
+ expect: {
+ if (console.log("PASS"))
+ e:;
+ else
+ e:;
+ }
+ expect_stdout: "PASS"
+}
+
+issue_4466_2_v8: {
+ mangle = {
+ toplevel: false,
+ v8: true,
+ }
+ input: {
+ if (console.log("PASS"))
+ A:;
+ else
+ B:;
+ }
+ expect: {
+ if (console.log("PASS"))
+ e:;
+ else
+ l:;
+ }
+ expect_stdout: "PASS"
+}
+
+issue_4466_2_toplevel: {
+ mangle = {
+ toplevel: true,
+ v8: false,
+ }
+ input: {
+ if (console.log("PASS"))
+ A:;
+ else
+ B:;
+ }
+ expect: {
+ if (console.log("PASS"))
+ e:;
+ else
+ e:;
+ }
+ expect_stdout: "PASS"
+}
+
+issue_4466_2_toplevel_v8: {
+ mangle = {
+ toplevel: true,
+ v8: true,
+ }
+ input: {
+ if (console.log("PASS"))
+ A:;
+ else
+ B:;
+ }
+ expect: {
+ if (console.log("PASS"))
+ e:;
+ else
+ e:;
+ }
+ expect_stdout: "PASS"
+}