diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-07 03:30:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 11:30:37 +0800 |
commit | 499f8d89ffd03f6f7d5b7235f4345516176e044b (patch) | |
tree | eb4b9b867609701fddc83a56257229da78c34d30 /test/compress/async.js | |
parent | 9eb65f3af36fd6546f83517f217625fdbaf9d6f1 (diff) | |
download | tracifyjs-499f8d89ffd03f6f7d5b7235f4345516176e044b.tar.gz tracifyjs-499f8d89ffd03f6f7d5b7235f4345516176e044b.zip |
fix corner case in `inline` (#4336)
fixes #4335
Diffstat (limited to 'test/compress/async.js')
-rw-r--r-- | test/compress/async.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js index 2e4698d2..8da545bd 100644 --- a/test/compress/async.js +++ b/test/compress/async.js @@ -216,3 +216,51 @@ collapse_vars_3: { expect_stdout: "PASS" node_version: ">=8" } + +issue_4335_1: { + options = { + inline: true, + } + input: { + var await = "PASS"; + (async function() { + console.log(function() { + return await; + }()); + })(); + } + expect: { + var await = "PASS"; + (async function() { + console.log(function() { + return await; + }()); + })(); + } + expect_stdout: "PASS" + node_version: ">=8" +} + +issue_4335_2: { + options = { + inline: true, + } + input: { + (async function() { + console.log(function() { + function await() {} + return "PASS"; + }()); + })(); + } + expect: { + (async function() { + console.log(function() { + function await() {} + return "PASS"; + }()); + })(); + } + expect_stdout: "PASS" + node_version: ">=8" +} |