aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-12 01:12:43 +0000
committerGitHub <noreply@github.com>2021-01-12 09:12:43 +0800
commit1e831df1f6a39ccc043384f04863aea58dbd7d9c (patch)
treecd589d14a749e260b518deac6dd5fbd8c804bd5a /test/compress
parentc12486bab4e445144968635e16b96943ed98b8c1 (diff)
downloadtracifyjs-1e831df1f6a39ccc043384f04863aea58dbd7d9c.tar.gz
tracifyjs-1e831df1f6a39ccc043384f04863aea58dbd7d9c.zip
fix corner case in `side_effects` (#4541)
fixes #4540
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/default-values.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index 23e31748..985651a3 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -1549,3 +1549,24 @@ issue_4523: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4540: {
+ options = {
+ reduce_vars: true,
+ side_effects: true,
+ }
+ input: {
+ console.log(function() {
+ function f([ a = 0 ]) {}
+ f([]);
+ }());
+ }
+ expect: {
+ console.log(function() {
+ function f([ a = 0 ]) {}
+ f([]);
+ }());
+ }
+ expect_stdout: "undefined"
+ node_version: ">=6"
+}