aboutsummaryrefslogtreecommitdiff
path: root/test/compress/destructured.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-25 12:10:58 +0000
committerGitHub <noreply@github.com>2020-12-25 20:10:58 +0800
commita1b2735dd8f7f89b7dd57ee7098f1720df28838f (patch)
treeafefaf120f2785e847ee1f65dd54685ceef71643 /test/compress/destructured.js
parentf345175bc2aef3cb9d3ceb6ec241cf191dd70eb7 (diff)
downloadtracifyjs-a1b2735dd8f7f89b7dd57ee7098f1720df28838f.tar.gz
tracifyjs-a1b2735dd8f7f89b7dd57ee7098f1720df28838f.zip
fix corner case in `unused` (#4457)
fixes #4456
Diffstat (limited to 'test/compress/destructured.js')
-rw-r--r--test/compress/destructured.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 7fe2f0c8..98e84f48 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -2164,3 +2164,36 @@ issue_4446: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4456: {
+ options = {
+ pure_getters: true,
+ unused: true,
+ }
+ input: {
+ var o = {
+ set p(v) {
+ console.log(v);
+ },
+ };
+ [ function() {
+ try {
+ return o;
+ } catch ({}) {}
+ }().p ] = [ "PASS" ];
+ }
+ expect: {
+ var o = {
+ set p(v) {
+ console.log(v);
+ },
+ };
+ [ function() {
+ try {
+ return o;
+ } catch ({}) {}
+ }().p ] = [ "PASS" ];
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}