I by prelude mean this object: http://gkz.github.com/prelude-ls/
Seems not good idea to bind prelude to window.__proto__, though.
I’m curious and confused about why this happend, and my code in Chrome:
window.__proto__ = prelude;
window.onload = function(){
console.log('loaded');
}
__proto__is a non-standard reference to the prototype of the window object (https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/proto).In your first line you are overwriting the entire prototype of
window. This means that everything else previously written to the prototype object gets list, including native functions that could be responsible for invokingwindow.onload.You should typically never overwrite the prototype object, but instead extend it or simply add new properties directly to objects like
window.