Strict mode recap

Lars Hansen lhansen at adobe.com
Fri Apr 4 09:57:36 PDT 2008


> -----Original Message-----
> From: es4-discuss-bounces at mozilla.org 
> [mailto:es4-discuss-bounces at mozilla.org] On Behalf Of liorean
> Sent: 4. april 2008 10:47
> To: es4-discuss at mozilla.org
> Subject: Re: Strict mode recap
> 
> On 04/04/2008, Lars Hansen <lhansen at adobe.com> wrote:
> >  Your comment about inhibiting static analysis isn't right; if ns::x

> > is a  name then either ns is known to be constant at compile time or

> > not, and  if it is, then nothing prevents early binding. ES3 systems

> > perform  analyses that are inhibited by eval and with, and
statically 
> > detect  whether eval and with are used in order to decide whether to

> > perform the  analyses.
> 
> I thought the argument was about the ns::[name] form... While 
> the namespace may be known at compile time, the actual 
> variable name is not - which means that the implementation 
> actually has to be able to look local variable names up as 
> strings, instead of just object members.
> 
> That is similar in effect to locally scoped eval. ES3 allows 
> restricting eval such that this string look up only has to 
> work if the compiler actually sees an "eval" in the fucntion 
> body, though. I guess the same argument can be made for these 
> dynamic namespace lookups too, however.

Sure, the situation with a variable namespace name and variable
identifier string is the same, and it is always visible to the
compiler.

(BTW I believe that locally bound names in ES4 cannot have explicit
namespaces, but that these names are defined in the common public
namespace (the one Jon calls 'null' though it will probably end
up being called 'public').  The forthcoming spec on names and name
lookup will clarify.)

--lars



More information about the Es4-discuss mailing list