diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-05 16:17:31 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-05 16:17:31 +0300 |
commit | 7ae09120ed5080ef09760def08dd7803ec977b1b (patch) | |
tree | 78597eeecee917ea01162818f01e504a474434e9 | |
parent | 42c25d901cb62917723b0b09285921de73d6eb6d (diff) | |
download | tracifyjs-7ae09120ed5080ef09760def08dd7803ec977b1b.tar.gz tracifyjs-7ae09120ed5080ef09760def08dd7803ec977b1b.zip |
prevent mangling only when eval is *called*, not when it's just referenced
-rw-r--r-- | lib/scope.js | 2 |
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; } |