[jQuery] Re: Augmentation

2008-12-01 Thread DiTieM
On Dec 1, 9:00 pm, "Dirceu Barquette" <[EMAIL PROTECTED]> wrote: > to call the widget: > $('').attr({id:'the_widget'}).mywidget(fff:function(){}); I must be missing something :((. I have tried to reduce my code to the next simple example. Notice I want to override the method A.fff in B.init to

[jQuery] Re: Augmentation

2008-12-01 Thread Dirceu Barquette
to call the widget: $('').attr({id:'the_widget'}).mywidget(fff:function(){}); Dirceu 2008/12/1 DiTieM <[EMAIL PROTECTED]> > > Maybe what I am pretending to do is something that JQuery wants to > avoid, but I am very frustrated with the following idea. Let's image > we have a simple "class": > >

[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

[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
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 object.pro

[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 to