aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-18 04:36:00 +0800
committerGitHub <noreply@github.com>2018-02-18 04:36:00 +0800
commit2351a672ea4fae04353f0221cec7ffb6c2c3bdc0 (patch)
tree5687af3ccdd3331eb93ac3e54cc92339e34cc407 /test
parent4a528c469c8b962912c8628fb312e772dd77fe2f (diff)
downloadtracifyjs-2351a672ea4fae04353f0221cec7ffb6c2c3bdc0.tar.gz
tracifyjs-2351a672ea4fae04353f0221cec7ffb6c2c3bdc0.zip
fix `dead_code` on exceptional `return` (#2930)
fixes #2929
Diffstat (limited to 'test')
-rw-r--r--test/compress/dead-code.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 9b45fe87..41f58427 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -917,3 +917,28 @@ issue_2860_2: {
}
expect_stdout: "1"
}
+
+issue_2929: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ console.log(function(a) {
+ try {
+ return null.p = a = 1;
+ } catch (e) {
+ return a ? "PASS" : "FAIL";
+ }
+ }());
+ }
+ expect: {
+ console.log(function(a) {
+ try {
+ return null.p = a = 1;
+ } catch (e) {
+ return a ? "PASS" : "FAIL";
+ }
+ }());
+ }
+ expect_stdout: "PASS"
+}