{ "id": "119236", "key": "ALOY-809", "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": "15753", "description": "2013 Sprint 22", "name": "2013 Sprint 22", "archived": true, "released": true, "releaseDate": "2013-11-01" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-10-29T22:24:28.000+0000", "created": "2013-08-29T08:23:08.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "15570", "description": "Alloy 1.2.1", "name": "Alloy 1.2.1", "archived": false, "released": true, "releaseDate": "2013-08-27" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-29T22:24:28.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12331", "name": "Titanium Studio" } ], "description": "h2. Description of the problem\r\nDue to a recent chance in the way event listeners in the view are added (using try/catch instead of the ternary operator), the debugger is now suspending the flow when the app starts, because of the handled exception.\r\n\r\nh2. Steps to reproduce\r\n1) Create new Alloy project\r\n2) open index.xml and replace \"doClick\" with \"exports.doClick\"\r\n3) open index.js and replace \"function doClick(e)\" with \"exports.doCLick = function(e)\"\r\n4) Run the app\r\n\r\nThe resulting file will contain:\r\n\r\n{code}\r\ntry {\r\n $.__views.label.addEventListener(\"click\", exports.doClick);\r\n} catch ( e ) {\r\n __defers[\"$.__views.label!click!exports.doClick\"] = true;\r\n}\r\n{code}\r\n\r\nPreviously, this was handled using a ternary operator, thus avoiding the try/catch.", "attachment": [], "flagged": false, "summary": "Debugger stops because of an exception when adding event listeners in the view", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 21, "state": "closed", "name": "2013 Sprint 22", "startDate": "2013-10-21T20:22:56.406Z", "endDate": "2013-11-03T21:23:56.406Z", "completeDate": "2013-11-21T16:47:05.851Z" } ], "comment": { "comments": [ { "id": "276667", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The try/catch method was implemented in order to allow arbitrary namespacing and JS in general to be used for identifying event handlers from markup. It resolved issues that were a problem with the prior method, resolved in ALOY-665. It is also noted that the user found a workaround for their particular situation. Finally, you can disable the behavior where Studio stops on exceptions by changing the setting like this:\r\n\r\n* Open Studio\r\n* Go to \"Preferences -> Studio -> Javascript Debug\"\r\n* Uncheck the \"suspend\" options until the desired behavior is met.\r\n\r\nGiven the above, I'm going to close this ticket.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-24T19:51:54.000+0000", "updated": "2013-10-24T20:29:36.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }