for-in evaluation order
bzbarsky at MIT.EDU
Mon Dec 27 03:42:24 PST 2010
On 12/27/10 5:39 AM, Michael Day wrote:
> Some quick testing with Firefox seems to show that for-in returns
> properties in the order they were added to the object
Yep; it's required for web compat, as you discovered. When we
accidentally broke it, we very quickly got bug reports. ;)
> and some scripts on the web (eg. RaphaelJS) seem to depend on that
> unless I'm
> horrendously misinterpreting them. This seems... bad?
Well, it's not bad except for ECMA's insistence on not specifying the order.
> Are objects implicitly ordered, by implementation convention?
For implementations that have to deal with the web, yes.
More information about the es-discuss