Skip to content

Commit

Permalink
enhance inline & unused (#5245)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Jan 1, 2022
1 parent 8d0422b commit 87a7426
Show file tree
Hide file tree
Showing 17 changed files with 987 additions and 231 deletions.
484 changes: 358 additions & 126 deletions lib/compress.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions test/compress/classes.js
Expand Up @@ -1646,10 +1646,8 @@ issue_4962_1: {
})(function g() {});
}
expect: {
(function g() {}),
void function() {
while (console.log(typeof g));
}();
(function g() {});
while (console.log(typeof g));
}
expect_stdout: "undefined"
node_version: ">=12"
Expand Down
20 changes: 8 additions & 12 deletions test/compress/const.js
Expand Up @@ -838,12 +838,10 @@ issue_4202: {
expect: {
{
const o = {};
(function() {
function f() {
o.p = 42;
}
f(f);
})();
function f() {
o.p = 42;
}
f(f);
console.log(o.p++);
}
}
Expand Down Expand Up @@ -1287,12 +1285,10 @@ issue_4261_2: {
expect: {
{
const a = 42;
(function() {
function g() {
while (void console.log(a));
}
while (g());
})();
function g() {
while (void console.log(a));
}
while (g());
}
}
expect_stdout: "42"
Expand Down
12 changes: 5 additions & 7 deletions test/compress/default-values.js
Expand Up @@ -2027,13 +2027,11 @@ issue_5222: {
f();
}
expect: {
(function() {
do {
a = void 0,
[ a ] = [];
} while (console.log("PASS"));
var a;
})();
do {
a = void 0,
[ a ] = [];
} while (console.log("PASS"));
var a;
}
expect_stdout: "PASS"
node_version: ">=6"
Expand Down

0 comments on commit 87a7426

Please sign in to comment.