`arguments` outside of a function is an ordinary variable.
authorMihai Bazon <mihai@bazon.net>
Thu, 17 Oct 2013 15:20:33 +0000 (18:20 +0300)
committerMihai Bazon <mihai@bazon.net>
Thu, 17 Oct 2013 15:20:33 +0000 (18:20 +0300)
Fix #501

lib/scope.js

index 8fc1ce0..713a2c9 100644 (file)
@@ -165,7 +165,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
                     for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
                         s.uses_eval = true;
                 }
-                if (name == "arguments") {
+                if (func && name == "arguments") {
                     func.uses_arguments = true;
                 }
             } else {