aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/dead-code.js24
-rw-r--r--test/compress/side_effects.js36
2 files changed, 60 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 62efa460..84e7613a 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1375,3 +1375,27 @@ issue_4051: {
}
expect_stdout: "PASS"
}
+
+issue_4366: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ function f() {
+ return "PASS";
+ ({
+ p: 42,
+ get p() {},
+ });
+ }
+ console.log(f());
+ }
+ expect: {
+ function f() {
+ return "PASS";
+ }
+ console.log(f());
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}
diff --git a/test/compress/side_effects.js b/test/compress/side_effects.js
index 0654a4ce..6428b172 100644
--- a/test/compress/side_effects.js
+++ b/test/compress/side_effects.js
@@ -470,3 +470,39 @@ issue_4325: {
}
expect_stdout: "PASS"
}
+
+issue_4366_1: {
+ options = {
+ side_effects: true,
+ }
+ input: {
+ ({
+ p: 42,
+ get p() {},
+ q: console.log("PASS"),
+ });
+ }
+ expect: {
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}
+
+issue_4366_2: {
+ options = {
+ side_effects: true,
+ }
+ input: {
+ ({
+ set p(v) {},
+ q: console.log("PASS"),
+ p: 42,
+ });
+ }
+ expect: {
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}