Resolution: Won't Fix
Affects Version/s: Release 3.1.1
Fix Version/s: None
Component/s: Code Processor
Appcelerator Studio 18.104.22.168305292130
Titanium SDK 3.1.1.v20130529114554
Code Processor results for Alloy projects are based an Analysis on the compiled code in the Resources folder.
(https://github.com/appcelerator/titanium-code-processor/tree/master/test_projects/ContextTest or attached here in the Jira)
In this case, the code to be analyzed is:
and the result, as expected, is that:
By placing the same identical code in an Alloy project index.js controller file, the result is a bit different.
Attached in the Jira there is the ContextTest sample for Alloy too.
After being compiled, the Resources/alloy/controllers/index.js looks like this:
so, lines 14 to 26 are the ones regarding the code put in the controller. The code is a bit different (for example the function "bar()" is declared before the 'var x = 10') and the Code Analyzer result is a bit different:
In this case the Code Processor is likely behaving correctly, in fact putting the generated code from lines 14 to 26 in a Classic Titanium project, I'm getting the same as the Alloy one.
The issue relates in the fact that from the end-user standpoint, the two results should be identical and the user could be easily confused by those results.
Attached both the classic and the Alloy 'ContextTest' sample projects and the Code Analyzer Results for each.