Is (eval)(code) a direct eval?

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Sat Oct 9 01:18:39 PDT 2010


  On 09.10.2010 6:57, Jeff Walden wrote:
> My reading of the spec says yes.  (eval evaluates to a Reference with 
> an environment record [object if in a with, lexical otherwise] as base 
> and "eval" as referenced name, and grouping does not GetValue.)  
> Anyone else think I'm mistaken?
>

No, you're not mistaken, it's a direct call to eval.

Dmitry.

P.S.: it's the same as determining /this/ value with applying grouping 
operator, which does not call GetValue. In contrast with other 
operations where the whole picture may confuse:

var bar = {
   baz: foo
};

bar.baz(); // bar

(bar.baz)(); // also bar
(bar.baz = bar.baz)(); // but here is global object
(bar.baz, bar.baz)(); // also global object
(false || bar.baz)(); // also global object

P.S.[2]: in addition regarding direct/indirect eval calls with examples: 
http://bit.ly/cNCHk2

> Jeff
> _______________________________________________
> es5-discuss mailing list
> es5-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es5-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20101009/bc69dbc6/attachment.html>


More information about the es5-discuss mailing list