fix corner case in ie8 & reduce_vars (#3706)

fixes #3703
This commit is contained in:
Alex Lam S.L
2020-02-05 20:03:22 +00:00
committed by GitHub
parent df506439b1
commit c93ca6ee53
2 changed files with 40 additions and 3 deletions

View File

@@ -6964,9 +6964,9 @@ merge(Compressor.prototype, {
var fn = node.fixed_value();
if (!(fn instanceof AST_Lambda)) return;
if (!fn.name) return;
var fn_def = fn.name.definition();
if (fn_def.scope !== fn.name.scope) return;
if (fixed.variables.get(fn.name.name) !== fn_def) return;
if (fn.name.definition() !== def) return;
if (def.scope !== fn.name.scope) return;
if (fixed.variables.get(fn.name.name) !== def) return;
fn.name = fn.name.clone();
var value_def = value.variables.get(fn.name.name) || value.def_function(fn.name);
node.thedef = value_def;