Strict mode recap

Waldemar Horwat waldemar at google.com
Mon Mar 31 17:02:52 PDT 2008


Here are the items mentioned for inclusion in strict mode:

- Don't turn a null 'this' value into the global object  (if non-strict mode in ES4 doesn't already do this)
- Throw on writes to read-only properties
- Throw on deletes of dontdelete properties
- delete o.x when x is not in o but in the proto will throw
- Reference before definition causes static errors (in some contexts?)
- Function arity checking at run time  (ES4 strict only)
- Disable global variable auto-creation when referencing one from, for example, within a function
- Disallow duplicate formal parameters
- Disallow duplicate names in object initializers
- Disable FunctionObject.arguments (not actually in ES3 but woefully used in practice)
- (Maybe) Disallow use of arguments object  (ES4 strict only)
- (Maybe) Disallow useless expressions
- Prohibit 'with' and locally scoped 'eval'.  Globally scoped 'eval', 'new Function', etc. would still be allowed.

    Waldemar



More information about the Es4-discuss mailing list