aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/async.js21
-rw-r--r--test/compress/objects.js23
2 files changed, 44 insertions, 0 deletions
diff --git a/test/compress/async.js b/test/compress/async.js
index d73bba41..ffd941c8 100644
--- a/test/compress/async.js
+++ b/test/compress/async.js
@@ -143,6 +143,27 @@ negate_iife: {
node_version: ">=8"
}
+object_function: {
+ options = {
+ properties: true,
+ side_effects: true,
+ }
+ input: {
+ ({
+ async f() {
+ console.log("PASS");
+ },
+ }).f();
+ }
+ expect: {
+ (async function() {
+ console.log("PASS");
+ })();
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}
+
collapse_vars_1: {
options = {
collapse_vars: true,
diff --git a/test/compress/objects.js b/test/compress/objects.js
index d35f1538..67acefd6 100644
--- a/test/compress/objects.js
+++ b/test/compress/objects.js
@@ -257,6 +257,29 @@ keep_computed_key: {
node_version: ">=4"
}
+shorthand_keywords: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unsafe: true,
+ unused: true,
+ }
+ input: {
+ var async = 1, get = 2, set = 3, o = {
+ async,
+ get,
+ set,
+ };
+ console.log(o.async, o.get, o.set);
+ }
+ expect: {
+ console.log(1, 2, 3);
+ }
+ expect_stdout: "1 2 3"
+ node_version: ">=6"
+}
+
issue_4269_1: {
options = {
evaluate: true,