[jQuery] Re: Augmentation of Object.prototype

2008-07-22 Thread Michael Geary
Greg, you can't extend Object.prototype. It will break more than just jQuery. As you noted, there is a workaround, but it requres code to be added to every for loop, which has a performance impact. Instead, simply revise the Object.prototype.Inherits function from that page so it does not need

[jQuery] Re: Augmentation of Object.prototype

2008-07-22 Thread Greg
Thanks for your reply. Some parts of my reply are below in you text. If you want to iterate over the members of an object you have to use 'hasOwnProperty' as showed at the first post. JavaScript iterate over all the prototypes members if you do anything. Why a library can't assume that

[jQuery] Re: Augmentation of Object.prototype

2008-07-22 Thread Michael Geary
If it's so BAD why Douglas Crockford in his book[1] has no problem with object.prototype augmentation ? For example, take a look : http://javascript.crockford.com/prototypal.html He says : The problem with Object.prototype.begetObject is that it trips up incompetent programs[..]

[jQuery] Re: Augmentation of Object.prototype

2008-07-22 Thread Greg
Adding checks into the library would add overhead Did you make some performance tests ? If it's so BAD why Douglas Crockford in his book[1] has no problem with object.prototype augmentation ? For example, take a look : http://javascript.crockford.com/prototypal.html He says : The problem with