{ "id": "124087", "key": "ALOY-907", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" }, { "id": "15759", "description": "Alloy 1.3.1", "name": "Alloy 1.3.1", "archived": false, "released": true, "releaseDate": "2014-02-10" }, { "id": "15765", "description": "2013 Sprint 26", "name": "2013 Sprint 26", "archived": true, "released": true, "releaseDate": "2014-01-03" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-12-20T20:27:10.000+0000", "created": "2013-12-20T19:14:46.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-02-05T17:53:34.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": [], "description": "When building an Alloy app with the following in the index.js controller:\r\n\r\n{code}\r\nfunction doClick(e) {\r\n alert($.label.text);\r\n}\r\n\r\n$.index.open(){};\r\n{code}\r\n\r\nAlloy outputs the following error:\r\n\r\n{code}\r\n[WARN] : ERROR: Unexpected token: punc ({) [null:5,14]\r\n[DEBUG]\r\n[DEBUG] C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:199\r\n[ERROR] (message, line, col, pos);\r\n[DEBUG] ^\r\n[ERROR]\r\n[ERROR] (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:185:18)\r\n[ERROR] (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:199:11)\r\n[DEBUG] at croak (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:630:9)\r\n[ERROR] (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:638:9)\r\n[DEBUG] at unexpected (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:644:9)\r\n[DEBUG] at semicolon (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:664:43)\r\n[DEBUG] at simple_statement (C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:822:73)\r\n[DEBUG] at C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:707:19\r\n[DEBUG] at C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:677:24\r\n[DEBUG] at C:\\Users\\Thomas Anderson\\AppData\\Roaming\\npm\\node_modules\\alloy\\node_modules\\uglify-js\\lib\\parse.js:1395:23\r\n[ERROR] Alloy compiler failed\r\n{code}\r\n\r\nThere are multiple problems with this output:\r\n\r\n1) The error is printed as a warning\r\n2) Nowhere does it indicate the actual filename containing the error\r\n3) It displays the entire stack trace of the Alloy code which is irrelevant to the user's app\r\n\r\nTo resolve this, Alloy should:\r\n\r\n1) Show the output as an error, not a warning\r\n2) Show the filename in which the error is found\r\n3) Do not show the stack trace\r\n4) The error should be displayed similar to the Titanium CLI which would look like:\r\n\r\n{code}\r\n[ERROR] Failed to minify C:\\Users\\Thomas Anderson\\Documents\\Appcelerator_Studio_Workspace\\testapp\\app\\controllers\\index.js\r\n[ERROR] Unexpected token: punc ({) [line 5, column 14]\r\n[ERROR] \r\n[ERROR] $.index.open(){};\r\n[ERROR] --------------^\r\n[ERROR]\r\n{code}", "attachment": [], "flagged": false, "summary": "JavaScript syntax error output is incorrect and confusing", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": "Alloy 1.3.0\r\nTitanium SDK 3.2.0\r\nAppcelerator Studio 3.2.0\r\nMac OS X 10.8.5 (Mountain Lion)\r\nWindows 8 64-bit", "comment": { "comments": [ { "id": "285419", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "commit: https://github.com/appcelerator/alloy/commit/063cd1b6c597044a81314582548a0c5472d22255\r\n\r\nMerged in both master and 1_3_X\r\n\r\nh3. functional test\r\n\r\n# Use the test app from the description\r\n# Compile alloy: {{alloy compile --platform ios}}\r\n# Assert that you now get a specific error with the stack trace suppressed, looking something like this:\r\n{code}\r\n[ERROR] Error generating AST for \"/Users/tlukasavage/Development/backwards/app/controllers/index.js\"\r\n[ERROR] Unexpected token: punc ({)\r\n[ERROR] line 5, column 14, position 64\r\n{code}", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-20T20:27:10.000+0000", "updated": "2013-12-20T20:27:10.000+0000" }, { "id": "287226", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested the app from description.\r\nh5. Actual result\r\n{code}\r\n[WARN] : : ERROR: Unexpected token: punc ({) [null:5,14]\r\n[ERROR] : Error generating AST for \"/Users/oromero/Documents/Appcelerator_Studio_Workspace2/before/app/controllers/index.js\"\r\n[ERROR] : Unexpected token: punc ({)\r\n[ERROR] : line 5, column 14, position 64\r\n[ERROR] : Alloy compiler failed\r\n{code}\r\n\r\nEnvironment:\r\nMac osx 10.9.1\r\nAppcelerator Studio, build: 3.2.1.201401071645\r\nTitanium SDK, build: 3.2.1.v20140106195644\r\nTitanium SDK, build: 3.3.0.v20140106195650\r\nNode.JS Version: v0.10.13\r\nNPM Version: 1.3.2\r\n├── acs@1.0.11\r\n├── alloy@1.3.1-beta\r\n├── npm@1.3.2\r\n├── titanium@3.2.0\r\n└── titanium-code-processor@1.1.0\r\n└── titanium@3.2.0 \r\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-08T18:07:47.000+0000", "updated": "2014-01-08T18:12:05.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }