aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-07-11 07:52:38 +0100
committerGitHub <noreply@github.com>2021-07-11 14:52:38 +0800
commit1ad830facb198878d7fe35586bca89c42b1ea263 (patch)
tree7c8e765244e22c91eed2807c4ef30eaaa0220bf1 /test
parent64ebf6efe939f9ea6a7b5bae8762460fdcc39ad7 (diff)
downloadtracifyjs-1ad830facb198878d7fe35586bca89c42b1ea263.tar.gz
tracifyjs-1ad830facb198878d7fe35586bca89c42b1ea263.zip
fix corner cases in `unused` (#5073)
fixes #5071
Diffstat (limited to 'test')
-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 7db2d238..45724b1a 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -2783,3 +2783,36 @@ issue_5017: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_5071_1: {
+ options = {
+ unused: true,
+ }
+ input: {
+ var a;
+ console.log(([ , a ] = [ "PA", , ]).join("SS"));
+ }
+ expect: {
+ var a;
+ console.log(([ , a ] = [ "PA", , ]).join("SS"));
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
+
+issue_5071_2: {
+ options = {
+ pure_getters: "strict",
+ unused: true,
+ }
+ input: {
+ var a;
+ ([ a ] = []).p = console.log("PASS");
+ }
+ expect: {
+ var a;
+ ([ a ] = []).p = console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}