I don't think many read language specs, but I've heard over and over
(in books and online) that you can't rely on the order that you get
when you use "in" to set through keys. I thought that was fairly well
known. Nothing in the syntax hints that you'd get them in a certain
order.

However, obviously if one implementation stands alone, it's in the
interest of that vendor to homogenize.

And if everyone is going to end up with the same de facto behavior,
then that behavior should be put into the standard, at least as an
addendum.

  --tt



On Sep 4, 1:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Yes, but every other implementation does that, so a lot of code
> implicitly relies on this. You don't really expect programmers to read
> language specs, do you?
>
> Jörn
>
> On Thu, Sep 4, 2008 at 9:53 PM, Matt Kruse <[EMAIL PROTECTED]> wrote:
>
> > On Sep 4, 2:00 pm, Feng <[EMAIL PROTECTED]> wrote:
> >> The second one is a bug in V8 (or Chrome). It returns reversed
> >> enumeration order of keys if the object is a literal.
>
> > This is not a bug in V8. The order of keys is never guaranteed to be
> > in the order they are inserted or specified in a literal.
>
> > Matt Kruse

Reply via email to