@@ -8226,7 +8226,7 @@ merge(Compressor.prototype, {
|
|||||||
if (compressor.option("side_effects")
|
if (compressor.option("side_effects")
|
||||||
&& can_drop
|
&& can_drop
|
||||||
&& all(fn.body, is_empty)
|
&& all(fn.body, is_empty)
|
||||||
&& (fn !== exp || fn_name_unused(fn, compressor))
|
&& (fn === exp ? fn_name_unused(fn, compressor) : !has_default && !has_destructured)
|
||||||
&& !(is_arrow(fn) && fn.value)) {
|
&& !(is_arrow(fn) && fn.value)) {
|
||||||
return make_sequence(self, convert_args()).optimize(compressor);
|
return make_sequence(self, convert_args()).optimize(compressor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1549,3 +1549,24 @@ issue_4523: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4540: {
|
||||||
|
options = {
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(function() {
|
||||||
|
function f([ a = 0 ]) {}
|
||||||
|
f([]);
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(function() {
|
||||||
|
function f([ a = 0 ]) {}
|
||||||
|
f([]);
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user