Property descriptors as ES6 Maps

Andrea Giammarchi andrea.giammarchi at gmail.com
Fri Nov 2 09:29:53 PDT 2012


I would add ... am I the only one that does not create a new object per
each defined property ? I am recycling descriptor.value like hell, I wonder
if anyone else out there is doing the same.


On Fri, Nov 2, 2012 at 1:31 AM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:

> 2012/11/1 David Bruant <bruant.d at gmail.com>
>
>> The constructor I have proposed could have an equivalent initialization
>> syntax.
>> Object.defineProperty({}, 'a', PropDesc({value:42, writable:true}))
>
>
> I see the merit in your proposal as making the Object->PropDesc conversion
> explicit. However, I think it's too late for ES6: Object.defineProperty
> must continue to accept Objects as its third argument, and that's even
> shorter to write. So even if we would add such a PropDesc constructor, I
> don't think most developers (including myself) would adapt.
>
> Cheers,
> Tom
>
> _______________________________________________
> 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/20121102/766ce14c/attachment.html>


More information about the es-discuss mailing list