possible excessive proxy invariants for Object.keys/etc??

Tom Van Cutsem tomvc.be at gmail.com
Wed Nov 21 12:13:08 PST 2012


2012/11/21 David Bruant <bruant.d at gmail.com>

>  Since the use of Object.getOwnPropertyNames may not be widespread, maybe
> that making non-enumerable unique symbol properties could do the trick (as
> it has with new {Object, Array, etc.}.prototype additions)
>
> 1bis) If all standard built-in names are private, they're not enumerated,
> neither in for-in, Object.keys, Object.getOwnPropertyNames and you can have
> a unique name in any of these enumeration operation if you've added them
> manually, so, no backward compat (or close enough that it's acceptable in
> my opinion)
>

Even disregarding the proxy whitelist hassle, let's not go there. Making
all the well-known unique symbols, like @iterator, private just so they
don't appear in Object.getOwnPropertyNames feels silly to me. We have the
distinction between unique and private symbols precisely because we've
identified a need for symbols that need to be unique but not necessarily
private!

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121121/b5645d4c/attachment.html>


More information about the es-discuss mailing list