{ "id": "170169", "key": "AC-5320", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-11-07T05:23:48.000+0000", "created": "2017-10-29T11:00:17.000+0000", "labels": [ "ios", "regression" ], "versions": [ { "id": "17032", "name": "Appcelerator Studio 4.3.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-11-07T05:23:48.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": "Declare a function in _alloy.js_\r\n{code:javascript}\r\nfunction test() {\r\n Ti.API.info(\"Hello!\");\r\n}\r\n{code}\r\n\r\nand try to invoke it in _index.js_ an you will see:\r\n\r\n{code}\r\n[ERROR] ReferenceError: Can't find variable: test\r\n[ERROR] File: app.js\r\n[ERROR] Line: 31\r\n[ERROR] SourceId: \r\n[ERROR] Backtrace:\r\n[ERROR] undefined\r\n{code}\r\n\r\non Android is working as well.", "attachment": [], "flagged": false, "summary": "iOS - functions declared in alloy.js are not globally visible", "creator": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti ", "comment": { "comments": [ { "id": "429793", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I can't reproduce the issue in iOS simulator 11.0, I define your function in alloy.js and call the function in index.xml in a button click event. The event fires fine for simulator build. Can you share a full code for this? ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-10-29T20:50:03.000+0000", "updated": "2017-10-29T20:50:03.000+0000" }, { "id": "429945", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~Andrea.Vitale],\r\n\r\nCan you please test the sample code from [here|https://gist.github.com/rakhimoni/e15cc150f82dbf0d5d5ff7ddd31b40a8] on your end and let us know how it goes.\r\n\r\nThanks", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-01T08:33:38.000+0000", "updated": "2017-11-01T08:33:38.000+0000" }, { "id": "430125", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~Andrea.Vitale],\r\n\r\nDid you manage to test sample code provided earlier?\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-05T06:35:41.000+0000", "updated": "2017-11-05T06:35:41.000+0000" }, { "id": "430149", "author": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi @Mostafizur, I tested your code and is working as well. Also my sample code that I tested before to open this issue now is working maybe due to the CLI that was outdated. Really don't know but is working. \r\n\r\nYou can close this issue, thanks!", "updateAuthor": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-06T08:01:38.000+0000", "updated": "2017-11-06T08:01:38.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }