{ "id": "121307", "key": "ALOY-852", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15403", "description": "Alloy 1.3.0", "name": "Alloy 1.3.0", "archived": false, "released": true, "releaseDate": "2013-12-20" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-01-06T19:21:00.000+0000", "created": "2013-10-17T07:09:39.000+0000", "priority": null, "labels": [ "alloy", "android", "build", "compiler" ], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-02-28T23:57:14.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "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.\r\n\r\nh1. Steps to reproduce\r\n\r\n1. Create a project: {{titanium create -p android -n suspicious --id ti.suspicious -d .}}\r\n2. Initialize Alloy: {{cd suspicious && alloy new}}\r\n3. Build for Play Store to trigger the closure-compiler: {{titanium build -p android -T dist-playstore -K ~/some.keystore -L someAlias -P somePassword -O ~/}}\r\n4. You'll see lots of warnings like these:\r\n\r\n{code}\r\n[INFO] Compiling javascript: alloy/controllers/index.js\r\n[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\r\n[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?\r\n arguments[0] ? arguments[0][\"__parentSymbol\"] : null;\r\n ^\r\n\r\n/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?\r\n arguments[0] ? arguments[0][\"$model\"] : null;\r\n ^\r\n\r\n/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?\r\n arguments[0] ? arguments[0][\"__itemTemplate\"] : null;\r\n ^\r\n\r\n0 error(s), 3 warning(s)\r\n\r\n[INFO] Compiling javascript: alloy.js\r\n[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\r\n[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 {}\r\n if (style.isId && opts.id && style.key === opts.id || style.isClass && _.contains(classes, style.key)) ; else {\r\n ^\r\n\r\n0 error(s), 1 warning(s)\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: closure-compiler warns for suspicious Alloy code", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "SDK 3.1.3.GA\r\nCLI 3.1.2\r\nAlloy 1.2.2", "comment": { "comments": [ { "id": "286772", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cbarber] I thought I heard mention that we might be doing something differently with respect to the closure-compiler for android. Is that true, and if so, could those changes perhaps be relevant here? ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-06T17:25:02.000+0000", "updated": "2014-01-06T17:25:02.000+0000" }, { "id": "286790", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~tlukasavage] Closure compiler has been ripped out and replaced by UglifyJS in 3.2.0. 3.1.x and older still uses Closure Compiler.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-06T18:36:16.000+0000", "updated": "2014-01-06T18:36:16.000+0000" }, { "id": "286799", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As [~cbarber] has stated, a different compiler is now being used as of TiSDK 3.2.0+ for these builds. This ticket is is no longer valid WRT to TiSDK, and we won't be backporting fixes for prior versions.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-06T19:21:00.000+0000", "updated": "2014-01-06T19:21:00.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }