Project: titanium
Issue TIMOB-19305: Alloy.Globals not accessible from a commonjs module
In iOS and Android I am able to access the Alloy.Globals without require in the Alloy module, but in Windows I have to require the module: var Alloy = require('alloy'); Before I can use the Globals variables like custom ones defined in the alloy.js file. As I said for iOS and Android this is not needed. I am not sure which is wrong and right here, because in the Alloy.Controller documentation it states that to be able to reach Alloy.createController or the collections one needs to require first, but this is not true for iOS and Android, maybe this is by chance it works for iOS and Android? I do not know. To reproduce: Module: (in the /lib folder) //var Alloy = require('alloy'); exports.test = function(){	Ti.API.info('Test Module');	Ti.API.info('Module Wintop ' + Alloy.Globals.winTop); }; In alloy.js: Alloy.Globals.winTop = 6; Ti.API.info('Wintop ' + Alloy.Globals.winTop); var t = require('testmod'); t.test(); Code will crash unless the require is included, but only for Windows...
Story points: 8