Distinguishing local eval from global eval
<p>Please consider the two snippets of code (the first prints "Local eval", the second prints "Global eval"):</p>

<pre><code>(function f() { 
    var x;
    try {
        eval("x");
        console.log('Local eval');
    }
    catch (e) {
        console.log('Global eval');
    }
}())
</code></pre>

<p>and </p>

<pre><code>var globalEval = eval;
(function f() { 
    var x;
    try {
        globalEval("x");
        console.log('Local eval');
    }
    catch (e) {
        console.log('Global eval');
    }
}())
</code></pre>

<p>It turns out that even though <code>globalEval === eval</code> evaluates to <code>true</code>, <code>globalEval</code> and <code>eval</code> <em>behave differently</em> because they have different names. (An eval can only be local if it is precisely written <code>eval</code>.)</p>

<p>How can I distinguish to two evals? Is there are a way to extract variable labels to infer behaviour?</p>
