aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/dead-code.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 93fc9f41..abc7384d 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1064,3 +1064,41 @@ issue_3552: {
}
expect_stdout: "PASS"
}
+
+unreachable_assign: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ console.log(A = "P" + (A = "A" + (B = "S" + (A = B = "S"))), A, B);
+ }
+ expect: {
+ console.log(A = "P" + "A" + (B = "S" + "S"), A, B);
+ }
+ expect_stdout: "PASS PASS SS"
+}
+
+catch_return_assign: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ console.log(function() {
+ try {
+ throw "FAIL";
+ } catch (e) {
+ return e = "PASS";
+ }
+ }());
+ }
+ expect: {
+ console.log(function() {
+ try {
+ throw "FAIL";
+ } catch (e) {
+ return "PASS";
+ }
+ }());
+ }
+ expect_stdout: "PASS"
+}