Traversal in insertion order for Set.prototype.add/delete
Qantas 94 Heavy
qantas94heavy at gmail.com
Wed Apr 23 20:54:02 PDT 2014
> We need a deterministic order. What deterministic order do you suggest?
> Why would it be better?
Sorry for the confusion, I completely worded that wrong.
I'm specifically referring to the specification sections 126.96.36.199
and 188.8.131.52 (specifying the behaviour for Set#add and Set#delete), which
6. Repeat for each e that is an element of entries, *in original insertion
I don't see any real reason why that's needed, unless there's some odd side
effects of doing so that I'm not aware of. Sets are meant to be unique and
I don't think the order of checking whether the element already exists
really matters. I'm not advocating for any change for the deterministic
order of iteration in Set#forEach and for-of loops on sets.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss