{ "id": "165156", "key": "AC-4704", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-01-10T18:25:36.000+0000", "created": "2017-01-02T21:27:59.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-01-10T18:25:36.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hello,\r\n\r\nWhen I do something like that on an Android (note that this code shouldn't exists at all in \"builded code\") : \r\n{code:javascript}\r\nif(OS_IOS){\r\n\tconst test = 'my string';\r\n}\r\n{code}\r\n\r\nI have this error: \r\n\r\n{code}\r\n[ERROR] : TiExceptionHandler: (main) [128,128] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [1,129] - In /app.js:60,10\r\n[ERROR] : TiExceptionHandler: (main) [0,129] - Message: Uncaught SyntaxError: Missing initializer in const declaration\r\n[ERROR] : TiExceptionHandler: (main) [0,129] - Source: const test;\r\n[ERROR] : V8Exception: Exception occurred at /app.js:60: Uncaught SyntaxError: Missing initializer in const declaration\r\n{code}\r\n\r\nAnd when I go the the \"builded\" file I have something like that : \r\n{code:javascript}\r\nconst test;\r\n{code}\r\n\r\nWhich is not good because \"const\" need to been initialized ... And also not good because const is block scoped !\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Strange issue when using \"const\" and conditional code", "creator": { "name": "Cryde", "key": "cryde", "displayName": "Jérémy Tonneau", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Cryde", "key": "cryde", "displayName": "Jérémy Tonneau", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested on Android\r\nBuild on Debian Jessie\r\nAppcelerator SDK 6.0.1\r\nCLI 6.1.0", "comment": { "comments": [ { "id": "404030", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I can't reproduce the issue with the below code. In Android I don't run into any error. \r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\r\n backgroundColor : 'white'\r\n\r\n});\r\nvar osname = Ti.Platform.osname;\r\n\r\nvar OS_IOS = (osname == 'iOS') ? true : false;\r\n\r\nif (OS_IOS) {\r\n\r\n const test = 'my string';\r\n\r\n}\r\n\r\nwin.open(); \r\n{code}\r\n\r\nCan you provide a full sample code to reproduce. I am testing on SDK 6.0.1.GA. Thanks. \r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-01-03T20:32:49.000+0000", "updated": "2017-01-03T20:32:49.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }