aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-23 20:08:57 +0000
committerGitHub <noreply@github.com>2020-12-24 04:08:57 +0800
commit7e575e9d7f40876373f073213126b729553c4d89 (patch)
tree7def9fb18c64a9263660839744b0773d3418e555 /test
parentcb4a02949e14a8ffad88c327204f016407218ce9 (diff)
downloadtracifyjs-7e575e9d7f40876373f073213126b729553c4d89.tar.gz
tracifyjs-7e575e9d7f40876373f073213126b729553c4d89.zip
fix corner case in `if_return` (#4439)
fixes #4438
Diffstat (limited to 'test')
-rw-r--r--test/compress/let.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/let.js b/test/compress/let.js
index fc323320..59b89023 100644
--- a/test/compress/let.js
+++ b/test/compress/let.js
@@ -1228,3 +1228,35 @@ issue_1753_toplevel: {
expect_stdout: "0"
node_version: ">=4"
}
+
+issue_4438: {
+ options = {
+ if_return: true,
+ }
+ input: {
+ "use strict";
+ function f() {
+ if (console) {
+ {
+ let a = console.log;
+ return void a("PASS");
+ }
+ }
+ }
+ f();
+ }
+ expect: {
+ "use strict";
+ function f() {
+ if (!console)
+ ;
+ else {
+ let a = console.log;
+ a("PASS");
+ }
+ }
+ f();
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}