Status: New
Owner: ----
New issue 422 by [email protected]: Order of object properties in a for..in
loop is not in insertion order
http://code.google.com/p/v8/issues/detail?id=422
In v8, the order of iteration of javascript properties in a for..in loop is
not the insertion order of object properties.
Although the ECMAScript standard deliberately does not specify the order of
enumerating properties (in fact, says explicitly that the order is not
specified), every other major javascript engine orders properties in
property-creation-order. This is an issue of compatibility with a de-facto
standard created by a consensus of other ECMAScript implementors, rather
than an issue of conforming with ECMAScript as written.
As an example test code, this javascript function:
function testit() {
var j;
var aStr;
j=[];
for(i=1363;i<1370;i++){j[i]=1}
aStr="";
for(d in j){aStr += " " + d;}
return aStr;
}
returns the string " 1364 1366 1363 1365 1369 1367 1368" on chrome, but the
string " 1363 1364 1365 1366 1367 1368 1369" on Firefox, IE, Safari, and
Opera.
Other bugs that somewhat touch on this appear to have been filed in the
past, but I was unable to find a v8 bug that focused specifically on this
issue.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---