{"action":"opened","issue":{"url":"https://api.github.com/repos/mozilla/rhino/issues/267","repository_url":"https://api.github.com/repos/mozilla/rhino","labels_url":"https://api.github.com/repos/mozilla/rhino/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/rhino/issues/267/comments","events_url":"https://api.github.com/repos/mozilla/rhino/issues/267/events","html_url":"https://github.com/mozilla/rhino/issues/267","id":132494236,"number":267,"title":"Object Property Order problem","user":{"login":"EnricoScoda","id":12053530,"avatar_url":"https://avatars.githubusercontent.com/u/12053530?v=3","gravatar_id":"","url":"https://api.github.com/users/EnricoScoda","html_url":"https://github.com/EnricoScoda","followers_url":"https://api.github.com/users/EnricoScoda/followers","following_url":"https://api.github.com/users/EnricoScoda/following{/other_user}","gists_url":"https://api.github.com/users/EnricoScoda/gists{/gist_id}","starred_url":"https://api.github.com/users/EnricoScoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnricoScoda/subscriptions","organizations_url":"https://api.github.com/users/EnricoScoda/orgs","repos_url":"https://api.github.com/users/EnricoScoda/repos","events_url":"https://api.github.com/users/EnricoScoda/events{/privacy}","received_events_url":"https://api.github.com/users/EnricoScoda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-09T18:27:42Z","updated_at":"2016-02-09T18:27:42Z","closed_at":null,"body":"I know it is not a but but seems that now all major browsers are ordering properties in `for .. in` loops this way:\r\n- first all numeric properties in numeric order\r\n- then the remaining properties using insertion order.\r\n\r\nSo it looks like they are using the \"sorting algorithm\" of Arrays for Objects.\r\nIf I'm right there are no specs forcing to use an algorithm for Objects but since modern browser use the algorithm I described (V8 started the game?), there is some code out there expecting this order.\r\nIs there a plan to adapt Rhino to the new wave? If I want to make a dirty patch, should I edit getIds of ScriptableObject?\r\n\r\nFor example the code:\r\n    `test['A'] = 'C';\r\n    test[1] = 'B';\r\n    test[0] = 'A';\r\n    for(var i in test) {\r\n        console.log(test[i]);\r\n    }`\r\non a modern browser will print A, B and C. Rhino (if a console object is available) will print C, B, A\r\n\r\nNote: I used Rhino 1.7.6, I will test on 1.7.7.1 later today."}}