私は、alertとconsole.logがIE8の通常のJavaScriptオブジェクトのように動作しないことに気付きました。誰にもこれについての説明がありますか? http://perfectionkills.com/whats-wrong-with-extending-the-dom/IE8のいくつかの組み込み関数がFunctionのインスタンスではないのはなぜですか?
ECMA-262の第三:こちらを発見
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
ブラウザを実装することができ、そのホストオブジェクトは、しかし、それは好きなので、それはおそらくです。 –