archives

« Bugzilla Issues Index

#4546 — Order of properties falsely described as implementation-specific


http://www.ecma-international.org/ecma-262/6.0/#sec-object.keys

“If an implementation defines a specific order of enumeration for the for-in statement, the same order must be used for the elements of the array returned in step 4.”

AFAICT, this is wrong on two accounts:

1. It’s not a question of “if an implementation defines a specific order” – it is defined for all implementations, by the spec.
2. The order doesn’t depend on for-in, it depends on [[OwnPropertyKeys]].

A note for EnumerableOwnNames [1] also misstates a dependency on for-in (similarly to #2 above):

“The order of elements in the returned list is the same as the enumeration order that is used by a for-in statement.”

[1] http://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames


Am I making sense?


*** Bug 4547 has been marked as a duplicate of this bug. ***