quite - hence I only do it for options as a special case:

https://github.com/DimitarChristoff/primish/blob/master/prime.js#L177-L178

--
Dimitar Christoff

"JavaScript is to JAVA what hamster is to ham"
@D_mitar - https://github.com/DimitarChristoff

On 5 Dec 2013, at 12:24, Arian Stolwijk <[email protected]> wrote:

> That is actually one of the design choices of prime that it doesn't do the 
> extra copying of property objects by default, rather it does less which is 
> better if you consider performance when creating new objects.
> 
> Probably setOptions could lookup the 'options' property of the inherited 
> prototypes and do the merge.
> 
> 
> On Thu, Dec 5, 2013 at 1:15 PM, Dimitar Christoff <[email protected]> wrote:
> this works out of the box in primish.
> 
> https://bitbucket.org/DimitarChristoff/primish-example/src
> 
> recrusive object merges in options was added recently - see 
> https://github.com/DimitarChristoff/primish/issues/3
> 
> previously you had to manually merge from parent prototypes.
> --
> Dimitar Christoff
> 
> "JavaScript is to JAVA what hamster is to ham"
> @D_mitar - https://github.com/DimitarChristoff
> 
> On 5 Dec 2013, at 11:50, santos <[email protected]> wrote:
> 
> > I have a better example:
> >
> > var A = prime({
> >     options: {
> >         name: 'image',
> >         tag: 'span',
> >         src: '/'
> >     },
> >     constructor: function(options){
> >         //console.debug(this.options);
> >         this.setOptions(options);
> >     },
> >     getOptions: function(){
> >         console.log(this.options);
> >     }
> > });
> >
> > var B = prime({
> >     inherits: A,
> >     options: {
> >         name: 'B'
> >     },
> >     some: function(){
> >         return;
> >     }
> > });
> >
> > var C = prime({
> >     inherits: B,
> >     options: {
> >         name: 'C'
> >     },
> >     some: function(){
> >         return;
> >     }
> > });
> >
> > mixin(A, Options);
> > mixin(B, Options);
> > mixin(C, Options);
> >
> > var c = new C({
> >     tag: 'div'
> > });
> >
> > c.getOptions();
> >
> > console.log(c.options); //the result should be: {name: "C", tag: "div", 
> > src: "/"}
> >
> > Thank you again.
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google Groups 
> > "MooTools Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected].
> > For more options, visit https://groups.google.com/groups/opt_out.
> 
> --
> 
> ---
> You received this message because you are subscribed to the Google Groups 
> "MooTools Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "MooTools Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to