Subj : JavaScript - Strict Mode? To : netscape.public.mozilla.jseng From : =?UTF-8?B?TGrDs3PDoWxmcg==?= Date : Wed Apr 02 2003 05:54 am Has anybody proposed a strict mode for JavaScript (and survived to tell about it)? I find JavaScript to be a mixed bag. in some ways it's very easy to work with and allows for some very elegant solutions. Sometimes, however, it can be very frustrating. An example is str=""; str+="Here's some text, "; str+="and some more, "; srt+="but why doesn't this show?"; str+=" This isn't fun anymore!"; I started to think about the possiblility of a strict mode wherein the programmer would be required to declare variables, etc. I'm not sure of all the features such a mode should have. I'm also not sure of the mechanism for activating such a mode. Should it be a switch in the code, or a browser/environment setting? Strict mode code would be completely valid JavaScript, and would run anywhere standard JavaScript would run. The reverse, of course, would not apply. Standard JavaScript would allow for undeclared variables, etc. Opinions? STH .