[[OwnPropertyKeys]] key ordering

Allen Wirfs-Brock allen at wirfs-brock.com
Sat Apr 19 11:35:18 PDT 2014

On Apr 19, 2014, at 11:21 AM, Mark S. Miller wrote:

> Awesome! Please let's do this!
> I don't understand the comment about Object.keys, etc. If they continue to be specified in terms of [[OwnPropertyKeys]], then they get cleaned up as well, which seems good.

Object.keys currently says it produces the same ordering as for-in , but for-in ordering is implementation defined.  We've never convinced ourselves that implementations would willing change to confirm to a required for-in ordering.

> Is there a reason why we might want to continue to underspecify Object.keys, etc?

The same reasons why it was under specified in the first place.  Implementation conformance and at this point concerns about breaking changes.

> If there is, how would you continue to underspecify Object.keys etc, while still cleaning up [[OwnPropertyKeys]]?

By saying: After retrieving the keys using [[OwnPropertyKeys]] an implementation must reordering to conform to the for-in enumeration order.

> Do we also have an opportunity to (finally!) pin down for/in ordering as part of this?

I don't think so, and I think that is too big of an issue to consider at this time.  But I don't see any reason that new functions should use a well specified ordering.


More information about the es-discuss mailing list