enhance compress on arrow and async functions (#4616)

This commit is contained in:
Alex Lam S.L
2021-02-06 04:39:46 +00:00
committed by GitHub
parent 739fa266f8
commit 5359900b78
5 changed files with 232 additions and 8 deletions

View File

@@ -434,6 +434,46 @@ collapse_value: {
node_version: ">=4"
}
collapse_property_lambda: {
options = {
collapse_vars: true,
pure_getters: "strict",
}
input: {
console.log(function f() {
f.g = () => 42;
return f.g();
}());
}
expect: {
console.log(function f() {
return (f.g = () => 42)();
}());
}
expect_stdout: "42"
node_version: ">=4"
}
drop_return: {
options = {
side_effects: true,
}
input: {
(a => {
while (!console);
return console.log(a);
})(42);
}
expect: {
(a => {
while (!console);
console.log(a);
})(42);
}
expect_stdout: "42"
node_version: ">=4"
}
reduce_iife_1: {
options = {
evaluate: true,