-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|678|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Link Home -> Dev-News


 
HoboBen
Created : 09 July 2010
 

JavaScript - ''use strict''



https://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions (generally providing the user with more information and a tapered-down coding experience).

Since ECMAScript 5 is backwards-compatible with ECMAScript 3, all of the "features" that were in ECMAScript 3 that were "deprecated" are just disabled (or throw errors) in strict mode, instead.

 

Comments


Saturday, 10 July 2010, 03:36
Cower
I like the sound of this. Out of curiosity, do you know if this is implemented now in current browsers, seeing as how it's been about a year? I don't pay that much attention to what's being done in that area.
Saturday, 10 July 2010, 04:32
HoboBen
Virtually all of them use ECMA-262 Edition 3 (e.g. ECMA 3). (Version 4 was abandoned)

However, some of the ECMA 5 features are being implemented by Mozilla (native JSON is already in there). I couldn't see a definite yes/no for strict mode though.

Strict mode is currently NOT available in webkit, though some other ECMAScript 5 features are, including native JSON.

I think Chrome/V8 might do it, albeit incompletely.

There's some more information on ECMAScript implementation status here.

It looks like JScript (as of IE8) might do native JSON but no clue about strict.

There's also JSLint if you want to check your code quality.