None of the major implementations had ever been in line with that particular ES6 specification. But note that exceptions were allowed in EcmaScript 2015-2019 (see this)
Concerning the described behaviour, see for instance the V8 bug report Issue 7874: Respect OrdinaryOwnPropertyKeys order.
While EcmaScript 2016, 2017 and 2018 specifications remained unchanged in this respect, it was decided to align EcmaScript2019 with reality. The section on [[OwnPropertyKeys]]() now reads:
- For each own property key P of O that is an array index, in ascending numeric index order, do
? ? a. Add P as the last element of keys.
So reference is to array index, which has an unchanged definition (+0 ≤ i < 232?1).
This change occurred in pull request Normative: Use array indices instead of integer indices in OrdinaryOwnPropertyKeys.
See also the comments and cross-references there.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…