Skip to content

Commit

Permalink
add test case for unused (#5341)
Browse files Browse the repository at this point in the history
closes #5340
  • Loading branch information
alexlamsl committed Feb 4, 2022
1 parent b106cd9 commit d338e45
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions test/compress/default-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -2148,3 +2148,64 @@ issue_5336: {
expect_stdout: "PASS"
node_version: ">=6"
}

issue_5340_1: {
options = {
keep_fargs: true,
pure_getters: "strict",
unused: true,
}
input: {
var a;
(function(b = 42) {})(({ p: a } = true).q);
console.log(a);
}
expect: {
var a;
(function(b = 0) {})(({ p: a } = true).q);
console.log(a);
}
expect_stdout: "undefined"
node_version: ">=6"
}

issue_5340_2: {
options = {
keep_fargs: true,
pure_getters: "strict",
side_effects: true,
unused: true,
}
input: {
var a;
(function(b = 42) {})(({ p: a } = true).q);
console.log(a);
}
expect: {
var a;
[ [].e = 0 ] = [ ({ p: a } = true).q ];
console.log(a);
}
expect_stdout: "undefined"
node_version: ">=6"
}

issue_5340_3: {
options = {
keep_fargs: false,
pure_getters: "strict",
unused: true,
}
input: {
var a;
(function(b = 42) {})(({ p: a } = true).q);
console.log(a);
}
expect: {
var a;
(function() {})(a = true["p"]);
console.log(a);
}
expect_stdout: "undefined"
node_version: ">=6"
}

0 comments on commit d338e45

Please sign in to comment.