[ALOY-920] should.js causes compiler error
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-10T17:17:00.000+0000 |
Affected Version/s | Alloy 1.4.0, Alloy 1.3.0 |
Fix Version/s | Alloy 1.4.0, Alloy 1.3.1, 2014 Sprint 01 |
Components | n/a |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2014-01-10T17:01:42.000+0000 |
Updated | 2014-07-10T17:17:00.000+0000 |
Description
If you attempt to compile an Alloy app that has [should.js](https://github.com/visionmedia/should.js) (the browser-compatible file that works with traditional Titanium dev), it will result in the following compile time error:
[INFO] ----- OPTIMIZING -----
[INFO] - iphone/alloy.js
[TRACE] processing "builtins" module...
[TRACE] processing "optimizer" module...
[TRACE] processing "compress" module...
[INFO] - iphone/should.js
WARN: ERROR: Unexpected token keyword «with», expected punc «(» [iphone/should.js:383,6]
[ERROR] Error generating AST for "/Users/tlukasavage/development/aloy920/Resources/iphone/should.js"
[ERROR] Unexpected token keyword «with», expected punc «(»
[ERROR] line 383, column 6, position 9813
We should investigate the root of the error, put in a quick fix, then address the specific problems with uglify-js either via new options or an update to uglify-js.
According to this ticket, this issue was resolved in uglify-js 2.4.8: https://github.com/mishoo/UglifyJS2/issues/319
PR: https://github.com/appcelerator/alloy/pull/297 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-920 Merged to both master and 1_3_X Skip compiling should.js for now. Uglify-js will be fixed in Alloy 1.4.0 with ALOY-921.
Functional Test
Run the given test app
Make sure you don't get the compile error noted in the description
make sure you get no runtime errors
Verified fixed - there are no compile errors. TiSDK 3.3.0.v20140516002513 Alloy 1.4.0-alpha Appcelerator Studio 3.3.0.201405121247 CLI 3.3.0-dev Closing
should.js provided in the app cause compile error. Environment used: Tested on: Device : iPod touch 2 , iOS version: 7.1.2 SDK: 3.3.0.v20140708132513 CLI version : 3.3.0-rc4 OS : MAC OSX 10.9.2 Alloy: 1.4.0-rc4 ACS: 1.0.15 npm:1.3.2 LiveView: 1.0.4 Appcelerator Studio, build: 3.3.0.201407081443 titanium-code-processor: 1.1.1 XCode : 5.1.1