Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16059

CLI: JavaScript syntax errors breaks build with cryptic message

    Details

      Description

      When building an app for device or distribution that contains an JavaScript error, a Node.js crash occurs.

      [INFO]  Processing JavaScript files
       
      /Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/titanium-sdk/lib/jsanalyze.js:64
      		var errmsg = [ __('Failed to minify %s', opts.filename) ];
      		               ^
      ReferenceError: __ is not defined
          at Object.analyzeJs (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/titanium-sdk/lib/jsanalyze.js:64:18)
          at Object.analyzeJsFile (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/titanium-sdk/lib/jsanalyze.js:35:17)
          at iOSBuilder.<anonymous> (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/iphone/cli/commands/_build.js:2860:24)
          at /Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:548:21
          at /Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:224:13
          at iterate (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:131:13)
          at async.eachSeries (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:147:9)
          at _asyncMap (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:223:9)
          at Object.mapSeries (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:213:23)
          at async.series (/Users/chris/Library/Application Support/Titanium/mobilesdk/osx/3.3.0/node_modules/node-appc/node_modules/async/lib/async.js:546:19)
      

      To reproduce, run the following app.js code:

      var win = Ti.UI.createWindow();
       
      win.crash(arg){};
      

      Expected results:

      [INFO]  Processing JavaScript files
      [ERROR] Failed to minify /Users/chris/appc/workspace/testapp2/Resources/app.js
      [ERROR] Unexpected token: punc ({) [line 3, column 14]
      [ERROR]   
      [ERROR]     win.crash(arg){};
      [ERROR]     --------------^
      [ERROR]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbarber Chris Barber
                Reporter:
                cbarber Chris Barber
                Reviewer:
                Allen Yeung
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-18088
                    Sync status:
                    ERROR
                    Last sent:

                    Git Source Code