fix corner case in reduce_vars (#4262)

fixes #4261
This commit is contained in:
Alex Lam S.L
2020-11-07 02:00:04 +00:00
committed by GitHub
parent c2f6fd5fde
commit 4bbeb09f7c
4 changed files with 93 additions and 14 deletions

View File

@@ -8429,7 +8429,7 @@ merge(Compressor.prototype, {
fixed.name = make_node(AST_SymbolLambda, fixed.name, fixed.name);
}
if (fixed instanceof AST_Lambda) {
var scope = self.scope;
var scope = self.scope.resolve();
fixed.enclosed.forEach(function(def) {
if (fixed.variables.has(def.name)) return;
if (scope.var_names()[def.name]) return;