aboutsummaryrefslogtreecommitdiff
path: root/test/compress/async.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-13 16:03:44 +0000
committerGitHub <noreply@github.com>2020-12-14 00:03:44 +0800
commitfcc40d0502a29e09a164ca04603db33b7dedfc3c (patch)
treea79473815b3d9c98ec0c7647b9dd361a9e18f14a /test/compress/async.js
parentb309527264ff7aea380df98021133bb3ff591a2d (diff)
downloadtracifyjs-fcc40d0502a29e09a164ca04603db33b7dedfc3c.tar.gz
tracifyjs-fcc40d0502a29e09a164ca04603db33b7dedfc3c.zip
fix corner case in `dead_code` (#4378)
fixes #4377
Diffstat (limited to 'test/compress/async.js')
-rw-r--r--test/compress/async.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js
index 71df2449..8b7f596e 100644
--- a/test/compress/async.js
+++ b/test/compress/async.js
@@ -471,3 +471,28 @@ issue_4359: {
expect_stdout: "PASS"
node_version: ">=8"
}
+
+issue_4377: {
+ options = {
+ dead_code: true,
+ inline: true,
+ side_effects: true,
+ }
+ input: {
+ console.log(typeof function() {
+ return function() {
+ f;
+ async function f() {}
+ return f();
+ }();
+ }().then);
+ }
+ expect: {
+ console.log(typeof function() {
+ return f();
+ async function f() {}
+ }().then);
+ }
+ expect_stdout: "function"
+ node_version: ">=8"
+}