compute uses_arguments correctly in figure_out_scope() (#2099)

fixes #2097
This commit is contained in:
Alex Lam S.L
2017-06-15 03:28:26 +08:00
committed by GitHub
parent 0a1e523cd5
commit 3f961bbba0
2 changed files with 31 additions and 3 deletions

View File

@@ -197,11 +197,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
}
}
var sym = node.scope.find_variable(name);
if (node.scope instanceof AST_Lambda && name == "arguments") {
node.scope.uses_arguments = true;
}
if (!sym) {
sym = self.def_global(node);
} else if (sym.scope instanceof AST_Lambda && name == "arguments") {
sym.scope.uses_arguments = true;
}
node.thedef = sym;
node.reference(options);