Minimalist (why) classes ?
Rick Waldron
waldron.rick at gmail.com
Sun Nov 13 07:42:45 PST 2011
On Nov 13, 2011, at 5:08 AM, Jake Verbaten <raynos2 at gmail.com> wrote:
>
>
> Neither of them are fit for standardization. Selfish and Prototype are both incapable of correctly "deep copying" arrays or objects,
>
> Why does it matter that they don't deep copy? Deep copying is a difficult problem that needs to be standardized separately.
It matters because I don't want data pollution across "instances". It's not a hard problem at all, jQuery.extend() has had deep copy for years.
> I've personally avoided deep copying for this reason and don't use it anymore.
>
> One can accept that an extend is merely a shallow copy properties by reference, because this (although limited) behavior is easy to understand.
>
> I have a version of Object.extend that is a "shallow own merge".
>
> However having a deep copy mechanism that works without obscure edge-cases would be great. Of course it would be nice if we had the choice of deep vs shallow copy within the API.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111113/ef819568/attachment.html>
More information about the es-discuss
mailing list