aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-05 16:17:31 +0300
committerMihai Bazon <mihai@bazon.net>2012-10-05 16:17:31 +0300
commit7ae09120ed5080ef09760def08dd7803ec977b1b (patch)
tree78597eeecee917ea01162818f01e504a474434e9
parent42c25d901cb62917723b0b09285921de73d6eb6d (diff)
downloadtracifyjs-7ae09120ed5080ef09760def08dd7803ec977b1b.tar.gz
tracifyjs-7ae09120ed5080ef09760def08dd7803ec977b1b.zip
prevent mangling only when eval is *called*, not when it's just referenced
-rw-r--r--lib/scope.js2
1 files changed, 1 insertions, 1 deletions
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;
}