Strict mode recap

Lars Hansen lhansen at adobe.com
Fri Apr 4 10:45:36 PDT 2008


> -----Original Message-----
> From: zeppieri at gmail.com [mailto:zeppieri at gmail.com] On 
> Behalf Of Jon Zeppieri
> Sent: 4. april 2008 11:38
> To: Lars Hansen
> Cc: liorean; es4-discuss at mozilla.org
> Subject: Re: Strict mode recap
> 
> >  I disagree, based on my experience analyzing uses of eval in
scripts  
> > written for the web, which to an astonishing degree evaluate simple

> > variable names or object.property phrases.
> 
> I've seen this, too, but rather than proving the utility of 
> this feature, I tend to consider it as evidence of a silent 
> epidemic of brain damage among ES programmers...

That could be true.  But it could also be the case that people 
find that it is easier to say

  var x = ...
  var y = ...
  var n = "x"  // but could be y

  ...
  // n may change here by assigning another string to it
  ...
  eval(n)

than 

  var x = ...
  var y = ...
  var n = function () { return x } // but could be y

  ...
  // n may change here by assigning another function to it
  ...
  n()

(and the latter does not handle shadowing, for better or worse).

--lars



More information about the Es4-discuss mailing list