aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/assignment.js16
-rw-r--r--test/compress/drop-unused.js34
-rw-r--r--test/compress/pure_getters.js20
3 files changed, 70 insertions, 0 deletions
diff --git a/test/compress/assignment.js b/test/compress/assignment.js
index ece0185d..ecd0ac4a 100644
--- a/test/compress/assignment.js
+++ b/test/compress/assignment.js
@@ -311,3 +311,19 @@ issue_3375: {
}
expect_stdout: "string"
}
+
+issue_3427: {
+ options = {
+ assignments: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var a;
+ a || (a = {});
+ })();
+ }
+ expect: {}
+}
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index d7f3cf76..6ed193e9 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -2028,3 +2028,37 @@ issue_3375: {
}
expect_stdout: "0 0"
}
+
+issue_3427_1: {
+ options = {
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var a;
+ a = a || {};
+ })();
+ }
+ expect: {}
+}
+
+issue_3427_2: {
+ options = {
+ unused: true,
+ }
+ input: {
+ (function() {
+ var s = "PASS";
+ console.log(s = s || "FAIL");
+ })();
+ }
+ expect: {
+ (function() {
+ var s = "PASS";
+ console.log(s = s || "FAIL");
+ })();
+ }
+ expect_stdout: "PASS"
+}
diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js
index b6e42f9d..54c89c6d 100644
--- a/test/compress/pure_getters.js
+++ b/test/compress/pure_getters.js
@@ -1187,3 +1187,23 @@ drop_arguments: {
}
expect_stdout: "PASS"
}
+
+issue_3427: {
+ options = {
+ assignments: true,
+ collapse_vars: true,
+ inline: true,
+ pure_getters: "strict",
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a;
+ (function(b) {
+ b.p = 42;
+ })(a || (a = {}));
+ }
+ expect: {}
+}