The precise meaning of "For each named own enumerable property name P of O"
david at davidflanagan.com
Fri Oct 9 22:35:06 PDT 2009
Allen Wirfs-Brock wrote:
> ES5 section 12.6 (for-in statement) says:
> The mechanics and order of enumerating the properties (step 6.a in the first algorithm, step 7.a in the second) is not specified. Properties of the object being enumerated may be deleted during enumeration. If a property that has not yet been visited during enumeration is deleted, then it will not be visited. If new properties are added to the object being enumerated during enumeration, the newly added properties are guaranteed not to be visited in the active enumeration.
> ES3 says pretty much the same thing with minor wording tweaks.
I'm resurrecting this thread from August because I just noticed that one
of the "minor wording tweaks" between the ES3 version and the ES5
version is this one:
ES3: "the newly added properties are not guaranteed to be visited"
ES5: "the newly added properties are guaranteed not to be visited"
The transposition of the two words makes a big difference that doesn't
seem like a minor tweak to me, and I can't find a discussion of it in
the mailing lists so I wanted to make sure that this was an intentional
rather than accidental change.
More information about the es-discuss