Object.define ==> Object.mixin??
brandon at brandonbenvie.com
Tue Dec 11 09:40:45 PST 2012
Wholeheartedly agree with this. For library authoring it's a necessity, so
a define like function is always the first thing in any .js file I make.
The need for library authors is obvious but if I recall the conclusion was
that those authors would be able to handle it themselves and to push off on
codifying it into the language so popular patterns could emerge. I think
that article well outlines how this is actually a need and concern in
authoring of non-library code. Specifically, accessors are a part of the
language (and are going to see more and more use as ES5 becomes the
baseline) and in order to correctly handle those for structure-copying you
must use descriptor-aware functions.
On Tue, Dec 11, 2012 at 12:28 PM, Allen Wirfs-Brock
<allen at wirfs-brock.com>wrote:
> I'm the past we discussed issues surrounding the semantic differences
> between "put" and "define" and we've agreed to include Object.assign in
> ES6. We have also discussed Object.define but have not yet made a decision
> to include it.
> Nicholas Zaka recently posted a short article that addresses issues
> relating to the assign/define distinction
> as they already surface in ES5.
> For me, this article reenforces that we really need to have something like
> Object.define in ES6.
> It also made me think that perhaps Object.mixin might be a more intuitive
> name for such a function.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss