fix uses_arguments handling (broken since 6605d15783)

Using the symbol declaration tracking of UglifyJS doesn't make sense here
anyway, `arguments` always comes from something in the current scope.

fixes #1299
This commit is contained in:
Jann Horn 2016-10-14 18:04:39 +02:00
parent 6389e52305
commit 83b124f0d6

View File

@ -204,6 +204,9 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
} }
} }
var sym = node.scope.find_variable(name); var sym = node.scope.find_variable(name);
if (node.scope instanceof AST_Lambda && name == "arguments") {
node.scope.uses_arguments = true;
}
if (!sym) { if (!sym) {
var g; var g;
if (globals.has(name)) { if (globals.has(name)) {
@ -215,9 +218,6 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
globals.set(name, g); globals.set(name, g);
} }
sym = g; sym = g;
if (func && name == "arguments") {
func.uses_arguments = true;
}
} }
node.thedef = sym; node.thedef = sym;
if (parent instanceof AST_Unary && (parent.operator === '++' || parent.operator === '--') if (parent instanceof AST_Unary && (parent.operator === '++' || parent.operator === '--')