Set iterators

Andreas Rossberg rossberg at google.com
Tue Feb 14 02:23:35 PST 2012


On 14 February 2012 09:47, David Bruant <bruant.d at gmail.com> wrote:
> For instance, what if Firefox and Chrome disagree, but iPhone safari and
> Android Webkit agree?
> Also, some products (Node.js (V8), MongoDB (SpiderMonkey), etc.) rely only
> on one JS engine, so JS code written for these could rely on the particular
> order of the given implementation. If it is the case, it will force these
> implementations to keep their order for backward-compat sake.
> Worst case, 2 non-compatible implementations are forced to keep their
> different order for some products built on top of them each relying on the
> particular order, making it impossible later to specify a given order.

To be sure, this is assuming that iteration order is fixed for a given
implementation. If order is not specified, then I don't see why that
should be required either. I.e., a completely randomized order (per
iteration) should be valid, too.

And I see potential reasons why order might differ for separate
iterations over the same collection.


> Determinism makes JavaScript code more interoperable.

I tend to agree. Underspecification in language definitions is a great
source for sleeper bugs.

/Andreas


More information about the es-discuss mailing list