aboutsummaryrefslogtreecommitdiff
path: root/test/compress/default-values.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-27 12:06:50 +0000
committerGitHub <noreply@github.com>2020-12-27 20:06:50 +0800
commit6a8aed20496cde3b22cad7c9309ec804c71e5c84 (patch)
treeb90cb63f7b9adfa64e472ca99a41d2e3ab2104a0 /test/compress/default-values.js
parenta8785fb6943e9cf8e370e19f29945e544b3be4b2 (diff)
downloadtracifyjs-6a8aed20496cde3b22cad7c9309ec804c71e5c84.tar.gz
tracifyjs-6a8aed20496cde3b22cad7c9309ec804c71e5c84.zip
fix corner case in `unused` (#4469)
fixes #4468
Diffstat (limited to 'test/compress/default-values.js')
-rw-r--r--test/compress/default-values.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index 0e05d37d..acd285f4 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -1160,3 +1160,31 @@ issue_4461_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4468: {
+ options = {
+ evaluate: true,
+ keep_fargs: false,
+ pure_getters: "strict",
+ reduce_vars: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function(a) {
+ var {
+ [console.log("PASS")]: b = a && (a.p = 0),
+ } = 0;
+ a;
+ })(1234);
+ }
+ expect: {
+ (function() {
+ var {
+ [console.log("PASS")]: b = 0,
+ } = 0;
+ })();
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}