{ "id": "119386", "key": "TIMOB-15029", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-09-03T15:58:30.000+0000", "created": "2013-09-03T14:40:03.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [ { "id": "31523", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "119250", "key": "TIMOB-15009", "fields": { "summary": "LiveView: cannot see Alloy.Globals in modules when using LiveView", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T22:04:29.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem description\r\nWhen using LiveView, the global variable Alloy.Globals is not defined in modules. Disabling LiveView would not throw the error.\r\n\r\nh2. Code to reproduce\r\nCreate an Alloy app with this code:\r\n\r\nindex.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:'#ffffff'\r\n});\r\n\r\nTi.API.info(Alloy.Globals.test);\r\n\r\nvar Test = require('test');\r\nnew Test();\r\n\r\nwin.open();\r\n{code}\r\n\r\nlib/test.js\r\n{code}\r\nfunction Test() {\r\n\tTi.API.info(Alloy.Globals.test);\r\n};\r\n\r\nmodule.exports = Test;\r\n{code}\r\n\r\nAdd the global variable in alloy.js:\r\n\r\n{code}\r\nAlloy.Globals.test = \"TEST\";\r\n{code}\r\n\r\nh2. Actual behavior\r\nWhen running the app with LiveView on, the following error is thrown:\r\n\r\n{code}\r\n[INFO] : [LiveView] Error Evaluating app.js @ Line: 2\r\n[ERROR] : TypeError: 'undefined' is not an object (evaluating 'Alloy.Globals')\r\n[ERROR] : File: app.js\r\n[ERROR] : Line: 2\r\n[ERROR] : SourceId: 323744256\r\n[ERROR] : Backtrace:\r\n[ERROR] : #0 Controller() at :21\r\n[ERROR] : #1 () at :214\r\n[ERROR] : #2 anonymous() at :15\r\n[ERROR] : #3 () at file://localhost/Users/dcassenti/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/4822E77B-90A1-4555-8E22-DA55E5976F16/DavideAlloyTestApp.app/app.js:628\r\n[ERROR] : #4 () at file://localhost/Users/dcassenti/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/4822E77B-90A1-4555-8E22-DA55E5976F16/DavideAlloyTestApp.app/app.js:493\r\n[ERROR] : #5 () at file://localhost/Users/dcassenti/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/4822E77B-90A1-4555-8E22-DA55E5976F16/DavideAlloyTestApp.app/app.js:460\r\n[ERROR] : #6 () at file://localhost/Users/dcassenti/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/4822E77B-90A1-4555-8E22-DA55E5976F16/DavideAlloyTestApp.app/app.js:392\r\n[ERROR] : #7 () at file://localhost/Users/dcassenti/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/4822E77B-90A1-4555-8E22-DA55E5976F16/DavideAlloyTestApp.app/app.js:663\r\n{code}\r\n\r\nWithout LiveView, the error is not shown. Note that in index.js the error is not thrown.", "attachment": [], "flagged": false, "summary": "LiveView: Alloy.Globals not visible in modules when using LiveView", "creator": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 3.1.2\r\nAlloy 1.2.1\r\nAppcelerator Studio", "comment": { "comments": [ { "id": "269281", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not positive why this was re-filed, but resolving as a duplicate.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-03T15:58:30.000+0000", "updated": "2013-09-03T15:58:30.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }