I noticed that alert and console.log do not work like normal JavaScript objects in IE8. Does anyone have explanation for this?
Good:
escape instanceof Function; // => true
escape.call; // => function call() { }
typeof escape; // => "function"
escape.test = 1; // => 1
Bad:
alert instanceof Function; // => false
alert.call; // => undefined
typeof alert; // => "object"
alert.constructor; // => undefined
alert.test = 1; // => Object doesn't support this property or method
Found here: http://perfectionkills.com/whats-wrong-with-extending-the-dom/
ECMA-262 3rd. ed:
The internal methods specification talks about are [[Get]], [[Put]], [[Delete]], etc. Note how it says that internal methods behavior is implementation-dependent. What this means is that it's absolutely normal for host object to throw error on invocation of, say, [[Get]] method.
So, IE doesn't violate the spec. The behaviour is consistent, and all built-in functions that are not a part of JavaScript language work like that. You cannot assign properties to them, they do not have prototypes and constructors.
Examples: