Good point. Note that you can easily do the same thing without copying, via 
prototypes:
https://github.com/rauschma/proto-js

On Nov 13, 2011, at 3:21 , Rick Waldron wrote:

> On Sat, Nov 12, 2011 at 7:08 PM, Brendan Eich <bren...@mozilla.com> wrote:
> snip
> 
> Let's argue about specifics or we'll get nowhere. Do you think Irakli's 
> selfish.js extend (https://github.com/Gozala/selfish/blob/master/selfish.js) 
> is the way to go, or Prototype's quite different form?
> 
> Neither of them are fit for standardization. Selfish and Prototype are both 
> incapable of correctly "deep copying" arrays or objects, resulting in new 
> "instances" being able to modify values of the base object's properties if 
> those values are elements of an array or property values of an object - 
> because the array and object property themselves are references, not real 
> copies.
> 
> PrototypeJS is painfully obvious, Selfish requires a demonstration. I 
> forked/cloned the repo and added a branch with a set of tests:
> 
> The branch: https://github.com/rwldrn/selfish/tree/test
> 
> The commit: 
> https://github.com/rwldrn/selfish/commit/ee55af5ec00074005fa74e9d9eb4be4dc4db5163
> 
> 
> An Object.extend() that creates an object full of references is certainly not 
> the way to go.
> 
> Rick
> 
>  
> 
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to