From 7ae09120ed5080ef09760def08dd7803ec977b1b Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Fri, 5 Oct 2012 16:17:31 +0300 Subject: prevent mangling only when eval is *called*, not when it's just referenced --- lib/scope.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scope.js') diff --git a/lib/scope.js b/lib/scope.js index 5f4a64a2..d926d4dc 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -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; } -- cgit v1.2.3