I am having a hard time understanding how this preserves a function an essentially extends it.
I see that (function(){}) will call a declared function immediately. I don't understand what supplying open as a parameter. Finally, I don't understand what goes on with (XMLHttpRequest.prototype.open). Is this calling the prototype function?
(function(open) {
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
open.call(this, arguments);
};
})(XMLHttpRequest.prototype.open);