aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-02 12:35:48 +0000
committerGitHub <noreply@github.com>2021-01-02 20:35:48 +0800
commit15ef2727903a00534efbfe5f416340fd73979767 (patch)
tree0ad7de9c29842f37a95745f20608f744e94265bf /test/compress
parentb3a706114ce775f75c4a6da37bff4a8ef32415d5 (diff)
downloadtracifyjs-15ef2727903a00534efbfe5f416340fd73979767.tar.gz
tracifyjs-15ef2727903a00534efbfe5f416340fd73979767.zip
introduce `awaits` (#4495)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/async.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js
index 4039dbb1..7ae753fb 100644
--- a/test/compress/async.js
+++ b/test/compress/async.js
@@ -142,6 +142,7 @@ dont_inline: {
inline_await_1: {
options = {
+ awaits: true,
inline: true,
reduce_vars: true,
unused: true,
@@ -167,6 +168,7 @@ inline_await_1: {
inline_await_1_trim: {
options = {
+ awaits: true,
if_return: true,
inline: true,
reduce_vars: true,
@@ -194,6 +196,7 @@ inline_await_1_trim: {
inline_await_2: {
options = {
+ awaits: true,
inline: true,
reduce_vars: true,
unused: true,
@@ -219,6 +222,7 @@ inline_await_2: {
inline_await_2_trim: {
options = {
+ awaits: true,
if_return: true,
inline: true,
reduce_vars: true,
@@ -246,6 +250,7 @@ inline_await_2_trim: {
inline_await_3: {
options = {
+ awaits: true,
inline: true,
reduce_vars: true,
unused: true,
@@ -270,6 +275,7 @@ inline_await_3: {
inline_await_3_trim: {
options = {
+ awaits: true,
inline: true,
reduce_vars: true,
sequences: true,
@@ -296,6 +302,7 @@ inline_await_3_trim: {
await_unary: {
options = {
+ awaits: true,
side_effects: true,
}
input: {
@@ -320,6 +327,28 @@ await_unary: {
node_version: ">=8"
}
+await_void: {
+ options = {
+ awaits: true,
+ if_return: true,
+ sequences: true,
+ side_effects: true,
+ }
+ input: {
+ (async function() {
+ console.log("PASS");
+ return await void 42;
+ })();
+ }
+ expect: {
+ (async function() {
+ await console.log("PASS");
+ })();
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}
+
evaluate: {
options = {
evaluate: true,