aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-08 03:26:03 +0000
committerGitHub <noreply@github.com>2020-12-08 11:26:03 +0800
commit47331597825f3feb2915a0c0c789c4e7ea9b57e8 (patch)
treeea8157fb8d243f91c93012344988fd1eed1c4581 /test
parent5fba98608ce2ce359cbf788196e64e4bbb48e303 (diff)
downloadtracifyjs-47331597825f3feb2915a0c0c789c4e7ea9b57e8.tar.gz
tracifyjs-47331597825f3feb2915a0c0c789c4e7ea9b57e8.zip
fix corner cases with `await` (#4350)
fixes #4349
Diffstat (limited to 'test')
-rw-r--r--test/compress/async.js57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js
index 4f342895..3011a6af 100644
--- a/test/compress/async.js
+++ b/test/compress/async.js
@@ -387,3 +387,60 @@ issue_4347_2: {
expect_stdout: "PASS"
node_version: ">=8"
}
+
+issue_4349_1: {
+ input: {
+ console.log(typeof async function() {
+ await /abc/;
+ }().then);
+ }
+ expect_exact: "console.log(typeof async function(){await/abc/}().then);"
+ expect_stdout: "function"
+ node_version: ">=8"
+}
+
+issue_4349_2: {
+ options = {
+ collapse_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(typeof async function() {
+ (function(a) {
+ this[a];
+ }(await 0));
+ }().then);
+ }
+ expect: {
+ console.log(typeof async function() {
+ (function(a) {
+ this[a];
+ }(await 0));
+ }().then);
+ }
+ expect_stdout: "function"
+ node_version: ">=8"
+}
+
+issue_4349_3: {
+ options = {
+ collapse_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(typeof function(await) {
+ return async function(a) {
+ this[a];
+ }(await);
+ }(this).then);
+ }
+ expect: {
+ console.log(typeof function(await) {
+ return async function(a) {
+ this[a];
+ }(await);
+ }(this).then);
+ }
+ expect_stdout: "function"
+ node_version: ">=8"
+}