aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/loops.js71
1 files changed, 71 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index b8d351ad..1fa3d00c 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -1126,3 +1126,74 @@ issue_4091_2: {
}
expect_stdout: "undefined"
}
+
+issue_4182_1: {
+ options = {
+ loops: true,
+ }
+ input: {
+ (function() {
+ do {
+ try {
+ return;
+ } finally {
+ continue;
+ }
+ console.log("FAIL");
+ } while (0);
+ console.log("PASS");
+ })();
+ }
+ expect: {
+ (function() {
+ do {
+ try {
+ return;
+ } finally {
+ continue;
+ }
+ console.log("FAIL");
+ } while (0);
+ console.log("PASS");
+ })();
+ }
+ expect_stdout: "PASS"
+}
+
+issue_4182_2: {
+ options = {
+ loops: true,
+ }
+ input: {
+ (function() {
+ L: do {
+ do {
+ try {
+ return;
+ } finally {
+ continue L;
+ }
+ console.log("FAIL");
+ } while (0);
+ console.log("FAIL");
+ } while (0);
+ console.log("PASS");
+ })();
+ }
+ expect: {
+ (function() {
+ L: do {
+ do {
+ try {
+ return;
+ } finally {
+ continue L;
+ }
+ } while (console.log("FAIL"), 0);
+ console.log("FAIL");
+ } while (0);
+ console.log("PASS");
+ })();
+ }
+ expect_stdout: "PASS"
+}