When I do this:
Object.prototype.toString.call( null )
or this:
Object.prototype.toString.call( )
the browsers return the following string value (in both cases):
Chrome 9: [object global]
Safari 5: [object DOMWindow]
Firefox 3.6: [object Window]
Opera 11: [object Window]
However in IE9 RC the return values are [object Null]
and [object Undefined]
respectively.
The ES5 specification states:
NOTE The thisArg value is passed without modification as the this value. This is a change from Edition 3, where a undefined or null thisArg is replaced with the global object and ToObject is applied to all other values and that result is passed as the this value.
See here: http://es5.github.com/#x15.3.4.4
Does this mean that IE9 is the only browser that follows this newly introduced rule?