avoid inline of function with special argument names (#2625)

This commit is contained in:
Alex Lam S.L
2017-12-20 02:48:04 +08:00
committed by GitHub
parent 2273655c17
commit fac003c64f
2 changed files with 92 additions and 4 deletions

View File

@@ -858,6 +858,7 @@ merge(Compressor.prototype, {
|| compressor.option("unsafe") && global_names(this.name);
});
var identifier_atom = makePredicate("Infinity NaN undefined");
function is_identifier_atom(node) {
return node instanceof AST_Infinity
|| node instanceof AST_NaN
@@ -4015,6 +4016,7 @@ merge(Compressor.prototype, {
return arg.__unused
|| safe_to_inject
&& !catches[arg.name]
&& !identifier_atom(arg.name)
&& !scope.var_names()[arg.name];
}) && scope;
}