In what ways does the following "eval" regularity break?

Kris Zyp kris at sitepen.com
Thu Oct 30 06:40:30 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
FWIW, a little empirical data:
>
>> I think we should even consider banning local eval from strict
>> mode.
>
> In light of the examples I gave above, and more that are pretty
> easy to find, I think this would make strict mode unused in
> practice.
>
In Dojo, eval is used with no need for local scope about 20 times, and
about 3 times needing local scope. Interestingly enough all three
times eval used local scope, it was in code that I have written (and I
have written a pretty small percentage of Dojo)... I could have missed
other cases where eval needed local scope, but it looked all the other
cases just really wanted global scope. The 3 cases certainly benefited
from local scope, and I could describe them if desired. It would be
possible to rewrite the code to not use local scope in the eval, but
it would be a pain.
Kris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iEYEARECAAYFAkkJuU4ACgkQ9VpNnHc4zAwxZQCgvZevkHtLgiIxUxcGp7Qz9lGA
DLMAn1UuD2NOIBU1rtYjKfs5oMkmmoJc
=rkn/
-----END PGP SIGNATURE-----



More information about the Es-discuss mailing list