Re: double checking if window.eval(…) is an indirect call to eval().
dmitry.soshnikov at gmail.com
Sat Aug 27 12:25:48 PDT 2011
On Sat, Aug 27, 2011 at 11:13 PM, John-David Dalton <
john.david.dalton at gmail.com> wrote:
> So I have read the section (and the notes associated with it) over
> what a direct call to eval is:
> > A direct call to the eval function is one that is expressed as a
> CallExpression that meets the following two conditions:
> > The Reference that is the result of evaluating the MemberExpression in
> the CallExpression has an environment record as its base value and its
> reference name is "eval".
> > The result of calling the abstract operation GetValue with that Reference
> as the argument is the standard built-in function defined in 126.96.36.199.
> But I am still a little unsure if `window.eval(…)` is a direct call or not.
> I have heard `window.eval()` is an indirect call but wanted to make sure.
> I see it as
> <call expression><member expression> window.eval</member expression>
> (…) </call expression>
> Wouldn't the result of evaluating the MemberExpression `window.eval`
> have global's environment record as its base and a reference name of
No. It's the global object what is the base (more precisely, its DOM's proxy
wrapper -- `window` or either the global itself), but not an environment
> Is `window.eval(..)` a direct call to eval?
No, it's indirect.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss