Minimalist (why) classes ?

Rick Waldron waldron.rick at gmail.com
Sat Nov 12 18:21:55 PST 2011


On Sat, Nov 12, 2011 at 7:08 PM, Brendan Eich <brendan at 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 at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111112/d069a48a/attachment-0001.html>


More information about the es-discuss mailing list