[ALOY-920] should.js causes compiler error

GitHub Issuen/a
Resolution Date2014-07-10T17:17:00.000+0000
Affected Version/sAlloy 1.4.0, Alloy 1.3.0
Fix Version/sAlloy 1.4.0, Alloy 1.3.1, 2014 Sprint 01
ReporterTony Lukasavage
AssigneeTony Lukasavage


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.


  1. Tony Lukasavage 2014-01-10 According to this ticket, this issue was resolved in uglify-js 2.4.8: https://github.com/mishoo/UglifyJS2/issues/319
  2. Tony Lukasavage 2014-01-10 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

  3. Federico Casali 2014-05-17 Verified fixed - there are no compile errors. TiSDK 3.3.0.v20140516002513 Alloy 1.4.0-alpha Appcelerator Studio CLI 3.3.0-dev Closing
  4. Paras Mishra 2014-07-09 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: titanium-code-processor: 1.1.1 XCode : 5.1.1

JSON Source