If it’s simply a case of messing up for…in loops, can’t you use Object.defineProperty to add your fn without making it enumerable?
So:
Object.defineProperty(Object.prototype, "foo", {
value: function() {
// do stuff
},
enumerable : false
});
Seems to work for me. Would this still be considered bad form?