Minimalist (why) classes ?
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:
> 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
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
An Object.extend() that creates an object full of references is certainly
not the way to go.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss