aboutsummaryrefslogtreecommitdiff
path: root/test/compress/awaits.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-03-07 02:33:51 +0000
committerGitHub <noreply@github.com>2021-03-07 10:33:51 +0800
commit397e48b97e18cf947c9c9eec0f66589cb92689a3 (patch)
treeb7c4a68d9894fe410b9bcdb3b67222238732f5bf /test/compress/awaits.js
parentc7520b4b971c0afcfb66a9ffa215d0d8e4a6fabe (diff)
downloadtracifyjs-397e48b97e18cf947c9c9eec0f66589cb92689a3.tar.gz
tracifyjs-397e48b97e18cf947c9c9eec0f66589cb92689a3.zip
fix corner case in `collapse_vars` & `reduce_vars` (#4748)
fixes #4747
Diffstat (limited to 'test/compress/awaits.js')
-rw-r--r--test/compress/awaits.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/awaits.js b/test/compress/awaits.js
index 0534d186..937fcb5a 100644
--- a/test/compress/awaits.js
+++ b/test/compress/awaits.js
@@ -1379,3 +1379,32 @@ issue_4738_3: {
expect_stdout: "PASS"
node_version: ">=8"
}
+
+issue_4747: {
+ options = {
+ collapse_vars: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function(a) {
+ async function f() {
+ a = "PASS";
+ null.p += "PASS";
+ }
+ f();
+ return a;
+ }("FAIL"));
+ }
+ expect: {
+ console.log(function(a) {
+ (async function() {
+ a = "PASS";
+ null.p += "PASS";
+ })();
+ return a;
+ }("FAIL"));
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}