Subj : Re: JavaScript - Strict Mode? To : netscape.public.mozilla.jseng From : Phil Schwartau Date : Wed Apr 02 2003 11:47 am A strict mode already exists. In the Mozilla browser, do this: Edit > Preferences > Debug > check "Show strict JavaScript warnings" Then adjust Tools > Web Development > JavaScript Console to make sure you see warnings as well as errors. (In the menubar under the File menubar, select "All"). Phil Ljósálfr wrote: > 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 > .