aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-06-22 17:36:07 +0100
committerGitHub <noreply@github.com>2021-06-23 00:36:07 +0800
commit95090dbf24dbda120924eb3cd003f80e0128f52a (patch)
treee3716c1d407492288c6c0f929eebb333ea59e820 /test/compress
parent7c5b6f349e5818a13ccb93c88b79a607d236bd0b (diff)
downloadtracifyjs-95090dbf24dbda120924eb3cd003f80e0128f52a.tar.gz
tracifyjs-95090dbf24dbda120924eb3cd003f80e0128f52a.zip
fix corner case in `side_effects` (#5024)
fixes #5023
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/awaits.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/compress/awaits.js b/test/compress/awaits.js
index 9b4d8ba7..adfc9e4a 100644
--- a/test/compress/awaits.js
+++ b/test/compress/awaits.js
@@ -1869,3 +1869,49 @@ issue_5019_3: {
]
node_version: ">=8"
}
+
+issue_5023_1: {
+ options = {
+ awaits: true,
+ reduce_vars: true,
+ side_effects: true,
+ }
+ input: {
+ (async function() {
+ let a = a;
+ })();
+ console.log("PASS");
+ }
+ expect: {
+ (async function() {
+ let a = a;
+ })();
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}
+
+issue_5023_2: {
+ options = {
+ awaits: true,
+ reduce_vars: true,
+ side_effects: true,
+ }
+ input: {
+ (async function() {
+ let a;
+ a = a;
+ })();
+ console.log("PASS");
+ }
+ expect: {
+ (function() {
+ let a;
+ a = a;
+ })();
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}