aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/default-values.js25
-rw-r--r--test/compress/destructured.js33
2 files changed, 58 insertions, 0 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index c65ccd35..d1637524 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -1726,3 +1726,28 @@ issue_4916: {
expect_stdout: "undefined"
node_version: ">=6"
}
+
+issue_4994: {
+ options = {
+ loops: true,
+ unused: true,
+ }
+ input: {
+ var a = "FAIL";
+ (function(b = function() {
+ for (a in { PASS: 42 });
+ }()) {
+ var a;
+ })();
+ console.log(a);
+ }
+ expect: {
+ var a = "FAIL";
+ (function(b = function() {
+ for (a in { PASS: 42 });
+ }()) {})();
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 78cd6863..41e337be 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -2592,3 +2592,36 @@ issue_4608_2: {
expect_stdout: "f"
node_version: ">=6"
}
+
+issue_4994: {
+ options = {
+ loops: true,
+ unused: true,
+ }
+ input: {
+ var a = "FAIL";
+ (function([
+ {
+ [function() {
+ for (a in { PASS: null });
+ }()]: b,
+ },
+ ]) {
+ var a;
+ })([ 42 ]);
+ console.log(a);
+ }
+ expect: {
+ var a = "FAIL";
+ (function([
+ {
+ [function() {
+ for (a in { PASS: null });
+ }()]: b,
+ },
+ ]) {})([ 42 ]);
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}