fix corner case in ie (#5193)

fixes #5192
This commit is contained in:
Alex Lam S.L
2021-11-24 09:29:26 +00:00
committed by GitHub
parent 1a8f2ecc65
commit bfd0ac7f4b
2 changed files with 20 additions and 1 deletions

View File

@@ -456,7 +456,7 @@ merge(Compressor.prototype, {
}
function can_drop_symbol(ref, compressor, keep_lambda) {
var def = ref.definition();
var def = ref.redef || ref.definition();
if (ref.in_arg && is_funarg(def)) return false;
return all(def.orig, function(sym) {
if (sym instanceof AST_SymbolConst || sym instanceof AST_SymbolLet) {

View File

@@ -1938,3 +1938,22 @@ issue_5138_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5192: {
options = {
dead_code: true,
ie: true,
}
input: {
(function a(a, [] = a = "PASS") {
console.log(a);
})("FAIL");
}
expect: {
(function a(a, [] = a = "PASS") {
console.log(a);
})("FAIL");
}
expect_stdout: "PASS"
node_version: ">=6"
}