fix corner cases in dead_code & inline (#5020)

fixes #5019
This commit is contained in:
Alex Lam S.L
2021-06-21 15:28:54 +01:00
committed by GitHub
parent 111366fca0
commit e9c902b044
3 changed files with 153 additions and 3 deletions

View File

@@ -11091,9 +11091,11 @@ merge(Compressor.prototype, {
});
var scan_scope = new TreeWalker(function(node) {
if (reachable) return true;
if (node instanceof AST_Scope && node !== self) {
var parent = scan_scope.parent();
if (parent instanceof AST_Call && parent.expression === node) return;
if (node instanceof AST_Lambda && node !== self) {
if (!(is_async(node) || is_generator(node))) {
var parent = scan_scope.parent();
if (parent instanceof AST_Call && parent.expression === node) return;
}
node.walk(find_ref);
return true;
}