fix corner case in rests (#5129)

fixes #5128
This commit is contained in:
Alex Lam S.L
2021-09-19 22:02:35 +01:00
committed by GitHub
parent 85786889bd
commit 55418fd460
2 changed files with 43 additions and 0 deletions

View File

@@ -5563,6 +5563,7 @@ merge(Compressor.prototype, {
fn = fn.fixed_value();
}
if (!(fn instanceof AST_Defun || fn instanceof AST_Function)) break;
if (fn.rest) break;
if (fn.uses_arguments) break;
if (fn === call.expression) {
if (fn.parent_scope !== self) break;