mangle unused nested AST_SymbolCatch correctly (#3038)

fixes #3035
This commit is contained in:
Alex Lam S.L
2018-03-30 16:23:09 +09:00
committed by GitHub
parent 06b9894c19
commit fa3250199a
2 changed files with 82 additions and 5 deletions

View File

@@ -434,16 +434,19 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options){
var redef = def.redefined();
if (redef) {
redefined.push(def);
def.references.forEach(function(ref) {
ref.thedef = redef;
ref.reference(options);
ref.thedef = def;
});
reference(node.argname);
def.references.forEach(reference);
}
descend();
if (!redef) mangle(def);
return true;
}
function reference(sym) {
sym.thedef = redef;
sym.reference(options);
sym.thedef = def;
}
});
this.walk(tw);
redefined.forEach(mangle);