| Page 1 of 1 | [ 2 posts ] |
|
Y.mix has a few mode to control the behavior of copying. i.e.
given the following case: var Foo = function() {} Foo.prototype.name = 'foo' var Bar = function() {} Bar.prototype.name = 'bar' Bar.prototype.sayMyName = function() { return this.name} var newFoo = Y.mix(new Foo(), new Bar()) is there a mode that is suppose to copy the sayMyName function to newFoo? in my test, none of the modes work. |
|
By default, Y.mix will not overwrite existing properties. Pass true as the third parameter to allow it to overwrite, then the appropriate mode should work (I think the docs are clear enough for you to choose the right one).
|
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group