prevent mangling only when eval is *called*, not when it's just referenced
authorMihai Bazon <mihai@bazon.net>
Fri, 5 Oct 2012 13:17:31 +0000 (16:17 +0300)
committerMihai Bazon <mihai@bazon.net>
Fri, 5 Oct 2012 13:17:31 +0000 (16:17 +0300)
lib/scope.js

index 5f4a64a..d926d4d 100644 (file)
@@ -203,7 +203,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
                     globals[name] = g;
                 }
                 node.thedef = g;
-                if (name == "eval") {
+                if (name == "eval" && tw.parent() instanceof AST_Call) {
                     for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
                         s.uses_eval = true;
                 }