{ "id": "151219", "key": "AC-354", "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": "2015-11-23T06:12:08.000+0000", "created": "2015-09-16T11:48:10.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updated": "2015-11-23T06:12:08.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "It looks like for Windows app.js is not part of the global scope, while indeed I know this is true for iOS and Android. \r\n\r\nIn app.js the global variables 'isAndroid', 'isWindows' are defined. In the next CommonJS module Windows Phone does't know these global variables. I tested it with other global variables. These are also not found. Android und iOS know these.\r\n\r\nI will try my iOS/Android project to get ready for Windows Phone. I use CommonJS modules and the require () method, instead of Ti.include(). Well, it would be great if it works consistently. From my perspective, like as with iOS / Android, then I would not need so much change to the code.", "attachment": [], "flagged": false, "summary": "Windows 'app.js' is not part of the global scope", "creator": { "name": "aschattat", "key": "aschattat", "displayName": "Antje Schattat", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aschattat", "key": "aschattat", "displayName": "Antje Schattat", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Windows 8.1 Pro\r\nSDK: 4.1.0.GA\r\nCLI: 4.1.2 Installed (Active)\r\nClassic App, not Alloy.", "comment": { "comments": [ { "id": "370507", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~aschattat], From your description it's not clear what you are trying to do. Please provide a sample test case for windows platform to regenerate the issue. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2015-11-17T10:02:19.000+0000", "updated": "2015-11-17T10:02:19.000+0000" }, { "id": "370509", "author": { "name": "aschattat", "key": "aschattat", "displayName": "Antje Schattat", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have in the file app.js a lot of variables, which are globally available in the app (iOS and Android). On Windows Phone the global variables are not available for other JS files. I have changed the normal variables in Ti.App variables for testing.\r\n\r\nWindows Phone Example:\r\nvar DISPLAY_WIDTH = 320; (old => available only in app.js) \r\nTi.APP.DISPLAY_WIDTH = 320; (new => available throughout the app)\r\n\r\nSince Appcelerator not yet 100% can provide an existing app for Windows Phone, I have canceled the test provisionally. There are too many (large and small) issues that do not justify the current effort.\r\n\r\nThe test project was already an older development. A Classic app instead Alloy.", "updateAuthor": { "name": "aschattat", "key": "aschattat", "displayName": "Antje Schattat", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-17T10:20:32.000+0000", "updated": "2015-11-17T10:20:32.000+0000" }, { "id": "371101", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi [~aschattat],\r\n\r\nI have tested this issue you reported and didn't reproduce it with the latest Ti SDK. When we declare any variable to the app.js file and call it to the other commonJS module file, get that variable successfully.\r\n\r\n*Testing Environment:*\r\nOperating System\r\n Name = Microsoft Windows 8.1 Enterprise\r\n Version = 6.3.9600\r\n Architecture = 32bit\r\n # CPUs = 4\r\n Memory = 4198961152\r\n\r\nNode.js\r\n Node.js Version = 0.12.7\r\n npm Version = 2.11.3\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\n\r\nTitanium SDK\r\n SDK Version = 5.1.0.GA, 5.0.2\r\n SDK Path = C:\\ProgramData\\Titanium\\mobilesdk\\mobilesdk\\win32\\5.1.0.GA\r\n Target Platform = windows\r\n\r\n\r\n*Test Code:*\r\n{code:title=app.js}\r\nvar data = \"this is global\";\r\nvar Window = require('ui/common/FirstView');\r\nvar win = new Window();\r\nwin.open();\r\n{code}\r\n{code:title=FirstView.js}\r\n//FirstView Component Constructor\r\nfunction FirstView() {\r\n\t//create object instance, a parasitic subclass of Observable\r\n\tvar self = Ti.UI.createWindow({\r\n\t\tbackgroundColor : '#ffffff'\r\n\t});\r\n\r\n\t//label using localization-ready strings from /i18n/en/strings.xml\r\n\tvar label = Ti.UI.createLabel({\r\n\t\tcolor : '#000000',\r\n\t\ttext : String.format(L('welcome'), 'Titanium'),\r\n\t\theight : 'auto',\r\n\t\twidth : 'auto'\r\n\t});\r\n\tself.add(label);\r\n\r\n\t//Add behavior for UI\r\n\tlabel.addEventListener('click', function(e) {\r\n\t\talert(data);\r\n\t});\r\n\r\n\treturn self;\r\n}\r\n\r\nmodule.exports = FirstView;\r\n{code}\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2015-11-23T06:11:26.000+0000", "updated": "2015-11-23T06:11:26.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }