{ "id": "174303", "key": "AC-6421", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2019-10-28T15:17:00.000+0000", "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-11-05T08:26:19.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Steps:\r\n1. Create test app\r\n{code:bash}\r\nti create --type app --id test.transpil --name test.transpil -p all -u 'example.com' -d .\r\n{code}\r\n2. Add this snippet into app.js\r\n\r\n{code:javascript}\r\n(function() {\r\n let a = {b: [1,2,3]};\r\n let r = 0;\r\n let test = function test() {\r\n if (!a) {\r\n return;\r\n }\r\n const b = a.b;\r\n for (let i = 0, l = b.length; i < l; i++) {\r\n r += b[i];\r\n }\r\n };\r\n test();\r\n console.log(r);\r\n})();\r\n{code}\r\n3. Build the app for device:\r\n{code:bash}\r\nti build -p ios -T device\r\n{code}\r\n4. Verify \"0\" in application output in console\r\n5. Verify transpiled code in \"build/iphone/assets/app_js\":\r\n{code:javascript}\r\nfunction(){var\r\na={b:[1,2,3]},\r\nr=0,\r\ntest=function test(){\r\nif(1)\r\n\r\n\r\n\r\nfor(var b=a.b,i=0,l=b.length;void 0>i;i++)\r\nr+=b[i];\r\n\r\n};\r\ntest(),\r\nconsole.log(r);\r\n}();\r\n{code}\r\n\r\nProblem is here: \"void 0>i\".\r\nCorrect application output is: \"6\".", "attachment": [], "flagged": false, "summary": "iOS: transpilation produces incorrect output to device", "creator": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "subtasks": [], "reporter": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "environment": "Ti SDK 8.2.1.GA\r\nmacOS 10.14.6\r\nbuild platform: ios\r\nbuild target: device", "comment": { "comments": [ { "id": "452440", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~s.volkov], The issue is only in the device? I wasn't able to reproduce the issue in the simulator. I got the below log\r\n{code}\r\n[INFO] test.transpil 1.0 (Powered by Titanium 8.2.0.6bfdf6e394)\r\n[INFO] 6\r\n[DEBUG] Firing app event: started\r\n{code}\r\n\r\nThanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-11-03T21:02:30.000+0000", "updated": "2019-11-03T21:02:30.000+0000" }, { "id": "452447", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Seeing as this is a device only thing, it's probably down to the minification side of things", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-11-04T10:35:09.000+0000", "updated": "2019-11-04T10:35:09.000+0000" }, { "id": "452467", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "Hi. Device only.", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2019-11-05T08:26:19.000+0000", "updated": "2019-11-05T08:26:19.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }