compress duplicated variable definitions (#1817)

These are surprisingly common, as people reuse the same variable name within loops or switch branches.
This commit is contained in:
Alex Lam S.L
2017-04-17 17:11:29 +08:00
committed by GitHub
parent 71a8d0d236
commit 4ffb6fce76
4 changed files with 73 additions and 11 deletions

View File

@@ -268,7 +268,7 @@ AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope){
AST_Lambda.DEFMETHOD("init_scope_vars", function(){
AST_Scope.prototype.init_scope_vars.apply(this, arguments);
this.uses_arguments = false;
this.def_variable(new AST_SymbolVar({
this.def_variable(new AST_SymbolConst({
name: "arguments",
start: this.start,
end: this.end