[AC-354] Windows 'app.js' is not part of the global scope
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-11-23T06:12:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Antje Schattat |
Assignee | Sharif AbuDarda |
Created | 2015-09-16T11:48:10.000+0000 |
Updated | 2015-11-23T06:12:08.000+0000 |
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.
In 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.
I 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.
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.
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. Windows Phone Example: var DISPLAY_WIDTH = 320; (old => available only in app.js) Ti.APP.DISPLAY_WIDTH = 320; (new => available throughout the app) Since 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. The test project was already an older development. A Classic app instead Alloy.
Hi [~aschattat], I 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. *Testing Environment:* Operating System Name = Microsoft Windows 8.1 Enterprise Version = 6.3.9600 Architecture = 32bit # CPUs = 4 Memory = 4198961152 Node.js Node.js Version = 0.12.7 npm Version = 2.11.3 Titanium CLI CLI Version = 5.0.5 Titanium SDK SDK Version = 5.1.0.GA, 5.0.2 SDK Path = C:\ProgramData\Titanium\mobilesdk\mobilesdk\win32\5.1.0.GA Target Platform = windows *Test Code:*
Thanks.