From 3f961bbba04a8cec0ab74f4a13deb4be217da877 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 15 Jun 2017 03:28:26 +0800 Subject: compute `uses_arguments` correctly in `figure_out_scope()` (#2099) fixes #2097 --- lib/scope.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/scope.js b/lib/scope.js index ea43f752..82a935a2 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -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); -- cgit v1.2.3