Does that mean, that you will have performance-problems when you save
big arrays of objects (witch childen etc.)  as an option? Does
MooTools copy the object when you add it as an option?

On Feb 1, 8:31 pm, nutron <[email protected]> wrote:
> MooTools 1.2 (and all previous instances of the library) unlink child
> members of options to prevent class pollution. Consider:
> var Widget = new Class({
>   options: {
>     fruits: {
>       apples: 'red'
>     }
>   }});
>
> //imaging that we do not unlink options.fruits
> var first = new Widget();
> var second = new Widget();
>
> first.options.fruits.apples = 'green';
> //you have now changed fruits.apples for the second instance, too
>
> MooTools 1.3 will fix this problem though. The sub-objects will inherit from
> their parents without affecting existing instances.
>
> -aaron
>
> On Sun, Feb 1, 2009 at 5:56 AM, jtreitz (via Nabble) <
> [email protected]<ml-user%[email protected]>
>
>
>
>
>
> > wrote:
>
> > Hey guys,
>
> > Recently I ran into some trouble with classes having parents and
> > childs. Seems to me that setOptions unlinks every object reference in
> > the given options array? I'm pretty sure it is intended to do so, so
> > my question is: why and what should I do instead?
>
> >http://nopaste.ch/e9f8771226015cc.html
>
> > Thank you
>
> >          Johannes
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/Options-unlinks-object-references--tp2253849p225...
> > To start a new topic under MooTools Users, email
> > [email protected]<ml-node%[email protected]>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in 
> context:http://n2.nabble.com/Options-unlinks-object-references--tp2253849p225...
> Sent from the MooTools Users mailing list archive at Nabble.com.- Hide quoted 
> text -
>
> - Show quoted text -

Reply via email to