Object.prototype.clone

Kris Zyp kriszyp at xucia.com
Sun Oct 21 22:35:40 PDT 2007


>> http://javascript.crockford.com/prototypal.html
It is the act of creating a object that inherits from/delegates to the 
provided object. Peter is suggesting sugar for one of the important 
mechanisms in a prototypal language. I believe the "copy" semantic is used 
in Self. "clone" is bit misleading (well, I think "copy" is too). With 
classes, we call it "subclassing". We could call it "subobject" :). Douglas 
calls it "begetObjet" (nice), I personally think it is very valuable 
construct and I like what it encourages, but on the otherhand it is so 
easy/compact to create (about 4 lines of code), and it doesn't seem to be 
the direction ES4 is headed, so it's omission seems reasonable.

> YAHOO.mst.app.code = (function(){
> // 1100+ lines...
>
I don't think this doesn't have anything to do with the topic.


Kris 




More information about the Es4-discuss mailing list