Description
When the CLI is parsing the JS files of an app, if there is a parsing error then it is surfaced as the following
C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:197
throw new JS_Parse_Error(message, line, col, pos);
^
Error
at new JS_Parse_Error (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:189:18)
at js_error (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:197:11)
at croak (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:656:9)
at token_error (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:664:9)
at expect_token (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:677:9)
at expect (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:680:36)
at expr_list (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:1172:44)
at subscripts (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:1310:30)
at subscripts (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:1287:20)
at subscripts (C:\ProgramData\Titanium\mobilesdk\win32\4.1.0.v20150614181235\node_modules\uglify-js\lib\parse.js:1287:20)
When building for Android it will be surfaced as the following
[ERROR] Failed to parse C:\Users\Windo_000\Documents\Appcelerator_Studio_Workspace\testCreate\Resources\app.js
[ERROR] Unexpected token punc «;», expected punc «,» [line 18, column 39]
[ERROR]
[ERROR] var doc = Ti.XML.parseString(xmlString;
[ERROR] ---------------------------------------^
[ERROR]
Steps To Reproduce
1. In an existing titanium project edit the app.js so that it will fail the parsing, remove a parentheses for example
2. Build the app for Windows
Actual Result
The parser fails with the first error
Expected Result
The parser should fail with an error indicating the reason why
https://github.com/appcelerator/titanium_mobile_windows/pull/289
Verified the fix. We not see a reason for parse failure like below:
Environment: Appc Studio: 4.1.0.201506211738 Ti SDK: 4.1.0.v20150622145911 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0-1 APPC CLI: 4.1.0-1 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows Phone Emulator : 8.1.1