prevent mangling only when eval is *called*, not when it's just referenced

This commit is contained in:
Mihai Bazon
2012-10-05 16:17:31 +03:00
parent 42c25d901c
commit 7ae09120ed

View 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;
}