Nailing object property order

Leon Arnott leonarnott at gmail.com
Sat Apr 18 13:10:13 UTC 2015


I was the one who authored that commit, but thanks.

Incidentally, I left off checks for the following behaviour which also
uses the OwnPropertyKeys ordering, on the basis that they're generally
too obscure to manifest in usual programs (but then, what do I know?):

 * Object.freeze/Object.seal/Object.isFrozen/Object.isSealed (when
given a proxy, springs its "defineProperty" trap for each element
returned by OwnPropertyKeys (unless "ownKeys" is also trapped and the
handler provides its own order))
 * Object.defineProperties (when given a proxy as arg 1, springs its
"getOwnPropertyDescriptor" trap for each element returned by
OwnPropertyKeys (unless "ownKeys" is also trapped and the handler
provides its own order))

Presumably, Object.getOwnPropertyDescriptors in ES7 will also fire
"defineProperty" in OwnPropertyKeys order. (It'd be kind of odd if it
didn't, especially since such internal details are now exposed to user
code.)


More information about the es-discuss mailing list