[[OwnPropertyKeys]] key ordering
Allen Wirfs-Brock
allen at wirfs-brock.com
Sat Apr 19 13:31:14 PDT 2014
On Apr 19, 2014, at 12:17 PM, Brendan Eich wrote:
> Did you check against http://wiki.ecmascript.org/doku.php?id=strawman:enumeration which links off to this es-discuss thread:
>
> https://mail.mozilla.org/pipermail/es-discuss/2011-March/012965.html
>
> Sounds good, just asking for a look-back at the big thread and strawman to see if there are any missing subtleties others have pointed out in the past.
In a separate message I made a change that addresses 32-bit value non-limits on index keys.
I fairly arbitrarily separated the string and symbol keys groups. At the specific implementation level this might complicate (or possibly simplify) things, but it seems like a useful distinction for consumers of these key lists. For example, if you don't care about symbol keys you can stop iterating over the key array as soon as you encounter a symbol.
If we didn't know that the web has property creation ordering dependencies I might have specified sorting the string keys (doesn't require recording property creation order). However, there is no natural sort order for symbols.
>
> /be
>
> Allen Wirfs-Brock wrote:
>> The ordering I propose is:
>> 1) All array index property keys, in ascending array index numeric order. Followed by:
>> 2) All other string property keys, in property creation order. Followed by:
>> 3) All symbol property keys, in property creation order
>>
>> Does anybody see any reason why we shouldn't specify (this) property ordering?
>
More information about the es-discuss
mailing list