fix corner case in reduce_vars (#4189)

fixes #4188
This commit is contained in:
Alex Lam S.L
2020-10-07 15:01:39 +01:00
committed by GitHub
parent bc6e105174
commit 9c0feb69e5
3 changed files with 80 additions and 18 deletions

View File

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