Reflect.* naming: defineProperty, deleteProperty vs. get, has, set?

Tom Van Cutsem tomvc.be at gmail.com
Fri Jan 3 23:02:43 PST 2014


`hasOwn` has been deprecated recently.

As for get, has and set, you mean renaming them to getProperty, setProperty
and hasProperty? I don't see much value in doing so. There are no primitive
operations that require the symmetry, and in practice I've found it
pleasant that the most common operations to intercept (property get and
set) have short names. Also, `get` and `set` mirror the corresponding
contextual keywords for accessor properties, which makes sense.

Cheers,
Tom


2014/1/3 Domenic Denicola <domenic at domenicdenicola.com>

>  I imagine the symmetry argument applies to hasOwn as well.
>  ------------------------------
> From: Domenic Denicola <domenic at domenicdenicola.com>
> Sent: 1/3/2014 11:17
> To: Tom Van Cutsem <tomvc.be at gmail.com>
> Cc: es-discuss at mozilla.org
> Subject: RE: Reflect.* naming: defineProperty, deleteProperty vs. get,
> has, set?
>
>   Can we change get, set, and has then?
>  ------------------------------
> From: Tom Van Cutsem <tomvc.be at gmail.com>
> Sent: 1/3/2014 10:49
> To: Domenic Denicola <domenic at domenicdenicola.com>
> Cc: es-discuss at mozilla.org
> Subject: Re: Reflect.* naming: defineProperty, deleteProperty vs. get,
> has, set?
>
>  'deleteProperty' was in fact originally called 'delete'. We changed it
> to avoid a conflict with the keyword, which occurs when importing the
> function (recall that the Reflect.* methods are actually functions exported
> from a module). While ES5 made it possible to use keywords as properties,
> you obviously still can't use keywords as ordinary function names.
>
>  defineProperty is by symmetry with the existing Object.defineProperty
> built-in. I believe the symmetry is more important than a shorter name.
>
>  Cheers,
> Tom
>
>
> 2014/1/3 Domenic Denicola <domenic at domenicdenicola.com>
>
>>  It seems like it would be nicer to change the former to define and
>> delete, respectively?
>>
>> _______________________________________________
>> 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/20140104/8a1482f0/attachment.html>


More information about the es-discuss mailing list