fix corner case in collapse_vars (#4686)

fixes #4685
This commit is contained in:
Alex Lam S.L
2021-02-24 21:31:12 +00:00
committed by GitHub
parent a5e6946f74
commit 72805ea73a
2 changed files with 24 additions and 1 deletions

View File

@@ -2119,7 +2119,9 @@ merge(Compressor.prototype, {
}
arg = null;
}
if (node instanceof AST_ObjectIdentity && (fn_strict || !tw.find_parent(AST_Scope))) {
if (node instanceof AST_ObjectIdentity && (fn_strict
|| !tw.find_parent(AST_Scope)
|| is_arrow(arg) && iife instanceof AST_New)) {
arg = null;
return true;
}