According to the specification, a string-valued property key whose numeric value is 2 ** 53 - 1
must be treated as an integer index.
According to the specification, the [[OwnPropertyKeys]]
internal method must enumerate property keys which is an integer index, in ascending numeric order.
According to the specification, Reflect.ownKeys
calls the [[OwnPropertyKeys]]
internal method.
So, the following code should show property keys in ascending numeric order (i.e., ["9007199254740990", "9007199254740991"]
) if my understanding is correct.
However, all the existing implementations show property keys in ascending chronological order of property creation (i.e., ["9007199254740991", "9007199254740990"]
).
console.log(Reflect.ownKeys({"9007199254740991": null, "9007199254740990": null}));
What is my mistake?