[Dojo-interest] lang.mixin to change constructor properties

Robert Mark robertmarkbram.lists at gmail.com
Fri Jan 24 02:40:55 EST 2014


> But I am still puzzled about this: the Augmenting Objects doc (
http://dojotoolkit.org/documentation/tutorials/1.9/augmenting_objects/)
states that lang.mixin "mixes in constructor property".
> What exactly does this mean? Can someone explain with an example?

OK, I get this now. When you use declare(), you can specify a special
property called "constructor" that Dojo understands.
- Because declare knows about this, declare.safeMixin knows to ignore it.
- But lang.mixin and lang.extend don't know about declare (and don't assume
that they are acting on objects resulting from declare()), so they will mix
in a property called "constructor" if there is one.




On Fri, Jan 24, 2014 at 5:30 PM, Robert Mark <robertmarkbram.lists at gmail.com
> wrote:

> OK, I understood my error here - mixing something into Rabbit instead of
> Rabbit.prototype.
>
> But I am still puzzled about this: the Augmenting Objects doc (
> http://dojotoolkit.org/documentation/tutorials/1.9/augmenting_objects/)
> states that lang.mixin "mixes in constructor property".
>
> What exactly does this mean? Can someone explain with an example?
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20140124/568605fe/attachment.htm 


More information about the Dojo-interest mailing list