Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-852

Android: closure-compiler warns for suspicious Alloy code

    Details

      Description

      It looks like the closure-compiler doesn't like the optimized Alloy code. Though it works fine, a log with all these warnings doesn't show off well on Appcelerator I would think.

      Steps to reproduce

      1. Create a project: titanium create -p android -n suspicious --id ti.suspicious -d .
      2. Initialize Alloy: cd suspicious && alloy new
      3. Build for Play Store to trigger the closure-compiler: titanium build -p android -T dist-playstore -K ~/some.keystore -L someAlias -P somePassword -O ~/
      4. You'll see lots of warnings like these:

      [INFO] Compiling javascript: alloy/controllers/index.js
      [DEBUG] java -jar "/Users/zandbergen/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/android/lib/closure-compiler.jar" --js /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy/controllers/index.js --js_output_file /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy/controllers/index.js-compiled --jscomp_off=internetExplorerChecks --accept_const_keyword
      [WARN] /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy/controllers/index.js:7: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?
          arguments[0] ? arguments[0]["__parentSymbol"] : null;
          ^
       
      /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy/controllers/index.js:8: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?
          arguments[0] ? arguments[0]["$model"] : null;
          ^
       
      /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy/controllers/index.js:9: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?
          arguments[0] ? arguments[0]["__itemTemplate"] : null;
          ^
       
      0 error(s), 3 warning(s)
       
      [INFO] Compiling javascript: alloy.js
      [DEBUG] java -jar "/Users/zandbergen/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/android/lib/closure-compiler.jar" --js /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy.js --js_output_file /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy.js-compiled --jscomp_off=internetExplorerChecks --accept_const_keyword
      [WARN] /Users/zandbergen/dev/tests/suspecious/build/android/bin/assets/Resources/alloy.js:156: WARNING - If this if/for/while really shouldnt have a body, use {}
              if (style.isId && opts.id && style.key === opts.id || style.isClass && _.contains(classes, style.key)) ; else {
              ^
       
      0 error(s), 1 warning(s)
      

        Attachments

          Activity

            People

            • Assignee:
              tlukasavage Tony Lukasavage
              Reporter:
              mpmiranda Mauro Parra-Miranda
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration