Strict mode recap

liorean liorean at gmail.com
Fri Apr 4 09:47:19 PDT 2008


>  > From: zeppieri at gmail.com [mailto:zeppieri at gmail.com] On
>  > Behalf Of Jon Zeppieri
> > > Let me turn it around.
>  > From my perspective, it isn't an E4X vs. ES4 distinction;
>  > it's a "looking up a property of a first-class object" vs.
>  > "using a local variable" (or, if you prefer, "looking up a
>  > property of an activation
>  > object") distinction.  It's not as if this is an uncommon
>  > distinction in programming languages, and the advantage of
>  > keeping the distinction is better static analysis, better
>  > performance, more tractable code.

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.
-- 
David "liorean" Andersson



More information about the Es4-discuss mailing list