|
James Burke |
at Mar 14, 2011 at 1:14 pm
|
⇧ |
| |
On Mon, Mar 14, 2011 at 9:34 AM, Kris Zyp wrote:I think this might have been mentioned for 1.6, but can we start more
proactively adding "use strict" pragmas to our modules for 1.7? Now that
FF4 is getting more stable (and surely will be released by 1.7) and has
use strict support, we have a decent platform to test on. This should be
a win in terms of improving code quality. A ticket:
http://bugs.dojotoolkit.org/ticket/12441 I suggest that if it is used, the "use strict" is inside the AMD
factory function. There are issues with combining code that does a
"use strict" at the top with code that is not "use strict" friendly. I
have hit this with requirejs, so just something to be aware of. I have
gone to a model of not using "use strict" but using JSLint to lint the
code, I feel like it gives a decent tradeoff on getting the form in a
more strict form. Although I'm curious where the gaps are with that
approach vs. explicitly setting "use strict". I am sure there are
some, the default value of "this" in unbound function calls probably
being one (which we should not be relying on anyway).
James