On Aug 3, 10:25 pm, Alex Hernandez <
alex.hernan...@gmail.com> wrote:
> Hi,
>
> I'm using a Web application that has some OO JS classes with their own
> methods and properties.
>
> For some reason this library do some validation on some methods that
> the objects owns. Due to the OO nature of Prototype (I guess) it adds
> a lot of new methods to the existing objects (I've checked that using
> Firebug DOM viewer), and some validations of the existing library
> throw some errors regarding those method inherited from prototype.
Exactly which methods is it complaining about?
>
> My question is if I can avoid Prototype to add those methods to the
> custom objects. Is there any workaround for this?
Prototype doesn't really add anything to "custom" objects. It adds
methods to some of the native ones - Array.prototype,
String.prototype, etc. (but not Object.prototype). Any objects
inheriting from those extended objects share added methods.
It would be pretty hard to make prototype *not* extend them without
changing the code base significantly.
You could also take a look Protosafe
http://www.protolific.net/
--
kangax