{ "id": "162581", "key": "TIMOB-23773", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2018-07-26T03:48:46.000+0000", "created": "2016-08-15T03:22:11.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-07-26T03:48:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "We have experienced wrong behavior on JavaScript for-in loop. I suspect JavaScriptCore has some issues with for-in loop, because this only happens on Windows Desktop (8.1 and 10.0) Jenkins. \r\n\r\nSee also:\r\nhttps://github.com/appcelerator/titanium_mobile_windows/pull/817\r\n\r\n*Test Code*\r\n\r\n{code}\r\nit('fireListSectionEvent (header and footer)', function (finish) {\r\n\tvar section = Ti.UI.createListSection({\r\n\t\t\theaderTitle: 'HEADER',\r\n \t\tfooterTitle: 'FOOTER',\r\n\t items: [\r\n\t { properties: { title: 'B' } },\r\n\t { properties: { title: 'A' } },\r\n\t { properties: { title: 'E' } },\r\n\t { properties: { title: 'G' } }\r\n\t ]\r\n\t }),\r\n\t listView = Ti.UI.createListView({ sections: [section] }),\r\n\t items_a = [\r\n\t { properties: { title: 'A' } },\r\n\t ],\r\n\t items_b = [\r\n\t { properties: { title: 'C' } },\r\n\t { properties: { title: 'D' } }\r\n\t ],\r\n\t items_c = [\r\n\t { properties: { title: 'E' } },\r\n\t { properties: { title: 'F' } },\r\n\t ],\r\n\t validation = ['A', 'B', 'C', 'D', 'E', 'F'];\r\n\r\n\tsection.updateItemAt(0, { properties: { title: 'A' } });\r\n\tsection.updateItemAt(1, { properties: { title: 'B' } });\r\n\tsection.updateItemAt(3, { properties: { title: 'F' } });\r\n\tsection.insertItemsAt(2, items_b);\r\n\tsection.deleteItemsAt(0, 1);\r\n\tsection.deleteItemsAt(3, 2);\r\n\tsection.appendItems(items_c);\r\n\tsection.insertItemsAt(0, items_a);\r\n\r\n\tvar items = section.getItems();\r\n\tshould(items.length).be.eql(6);\r\n\tfor (var i in items) {\r\n\t var item = items[i].properties.title;\r\n\t should(item).be.eql(validation[i]);\r\n\t}\r\n\r\n\tfinish();\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Windows: Wrong items returned on for-in loop", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "393134", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Based on discussions from WebKit Bugzilla, it seems WebKit committers actually don't quite care about for-in loop against Array. They think it's a bad idea doing it. https://bugs.webkit.org/show_bug.cgi?id=14901 ", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-15T11:39:24.000+0000", "updated": "2016-08-15T11:39:24.000+0000" }, { "id": "439486", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as we haven't seen this error for a while since we have updated our JavaScriptCore. Feel free to create new ticket if this happens again.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-07-26T03:48:46.000+0000", "updated": "2018-07-26T03:48:46.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }