Property ordering of [[Enumerate]] / getOwnPropertyNames()

John-David Dalton john.david.dalton at gmail.com
Wed Sep 2 23:10:18 UTC 2015


Hiya,

> [Enumerate]] must obtain the own property keys of the target object as if
by calling its [[OwnPropertyKeys]] internal method

Whoa that's tricky language. I assumed reading it that [[Enumerable]] was
to follow the order of [[OwnPropertyKeys]] (as part of "as if by") and
walking the prototype chain.

It's odd to me that:

  Reflect.ownKeys() has defined order but
  Reflect.enumerate() doesn't

I'm using Reflect.enumerate() to create a `keysIn` implementation (like
`keys` but for own & inherited key names).

:+1: for more defined behavior in ES7.


- JDD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150902/25d1b0c2/attachment.html>


More information about the es-discuss mailing list