Christoph: Nützliche JavaScript-Schnipsel

Beitrag lesen

Moin.

Dass window instanceof Object === false scheint ein Bug zu sein, denn window.\_\_proto\_\_ instanceof Object === true.

Genauer:

alert(window.\_\_proto\_\_) ergibt '[xpconnect wrapped native prototype]'
alert(window.\_\_proto\_\_.\_\_proto\_\_) ergibt '[object Global Scope Polluter]'
alert(window.\_\_proto\_\_.\_\_proto\_\_.\_\_proto\_\_) ergibt '[object Object]'

Und window.\_\_proto\_\_.\_\_proto\_\_.\_\_proto\_\_ === Object.prototype ist true. Also ist Object.prototype Teil der [[Prototype]]-Kette von window.

Blöder Firefox ;)

Christoph