Reflect.* naming: defineProperty, deleteProperty vs. get, has, set?
domenic at domenicdenicola.com
Fri Jan 3 08:17:10 PST 2014
Can we change get, set, and has then?
From: Tom Van Cutsem<mailto:tomvc.be at gmail.com>
Sent: 1/3/2014 10:49
To: Domenic Denicola<mailto:domenic at domenicdenicola.com>
Cc: es-discuss at mozilla.org<mailto: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.
2014/1/3 Domenic Denicola <domenic at domenicdenicola.com<mailto: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<mailto:es-discuss at mozilla.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss