fix corner case in arguments & reduce_vars (#3331)

fixes #3282
This commit is contained in:
Alex Lam S.L
2019-03-13 08:46:03 +08:00
committed by GitHub
parent e250396d7e
commit d4ac84b255
2 changed files with 174 additions and 2 deletions

View File

@@ -6334,8 +6334,8 @@ merge(Compressor.prototype, {
&& expr instanceof AST_SymbolRef
&& expr.name == "arguments"
&& expr.definition().orig.length == 1
&& (fn = expr.scope) instanceof AST_Lambda
&& prop instanceof AST_Number) {
&& prop instanceof AST_Number
&& (fn = expr.scope) === compressor.find_parent(AST_Lambda)) {
var index = prop.getValue();
var argname = fn.argnames[index];
if (argname && compressor.has_directive("use strict")) {