diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-25 11:27:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-25 19:27:05 +0800 |
commit | f345175bc2aef3cb9d3ceb6ec241cf191dd70eb7 (patch) | |
tree | 58ef049e91359552f79934d394832c8be551086f /test | |
parent | bb45f48ab74c25a108bb480ca5dd24f94599a35a (diff) | |
download | tracifyjs-f345175bc2aef3cb9d3ceb6ec241cf191dd70eb7.tar.gz tracifyjs-f345175bc2aef3cb9d3ceb6ec241cf191dd70eb7.zip |
fix corner case in `merge_vars` (#4455)
fixes #4454
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/async.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js index bf4d55c8..19b90f51 100644 --- a/test/compress/async.js +++ b/test/compress/async.js @@ -640,3 +640,59 @@ issue_4417: { expect_stdout: "undefined" node_version: ">=8" } + +issue_4454_1: { + rename = false + options = { + merge_vars: true, + } + input: { + function f(a) { + (async function(b = console.log(a)) {})(); + var await = 42..toString(); + console.log(await); + } + f("PASS"); + } + expect: { + function f(a) { + (async function(b = console.log(a)) {})(); + var await = 42..toString(); + console.log(await); + } + f("PASS"); + } + expect_stdout: [ + "PASS", + "42", + ] + node_version: ">=8" +} + +issue_4454_2: { + rename = true + options = { + merge_vars: true, + } + input: { + function f(a) { + (async function(b = console.log(a)) {})(); + var await = 42..toString(); + console.log(await); + } + f("PASS"); + } + expect: { + function f(b) { + (async function(c = console.log(b)) {})(); + var b = 42..toString(); + console.log(b); + } + f("PASS"); + } + expect_stdout: [ + "PASS", + "42", + ] + node_version: ">=8" +} |