{ "id": "142405", "key": "TIMOB-18336", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2015-01-12T22:24:44.000+0000", "created": "2015-01-07T07:06:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.5.0", "regression" ], "versions": [ { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T22:38:51.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "JavaScript function overriding doesn't work in 3.5.0\r\nh6. It's a regression since it works fine in 3.4.1 GA\r\n\r\nh5. Steps To Reproduce\r\n1. Create a Classic App\r\n2. Replace following code in app.js file\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\r\nvar b = Ti.UI.createButton({\r\n\ttitle:\"Alert\",\r\n\twidth:200,\r\n\theight:40,\r\n\ttop:50\r\n});\r\nb.addEventListener('click', function() {\r\n\talert(\"durp durp durp\");\r\n});\r\nwin.add(b);\r\nvar b2 = Ti.UI.createButton({\r\n\ttitle:\"Change alert\",\r\n\twidth:200,\r\n\theight:40,\r\n\tbottom:50\r\n});\r\nb2.addEventListener('click', function() {\r\n\talert = function(e) {\r\n\t\tTi.API.info(\"durp durp durp\");\r\n\t};\r\n});\r\nwin.add(b2);\r\nwin.open();\r\n{code}\r\n\r\n3. Run on iOS device\r\n4. Click on *Alert* button. It will alert a message \"durp durp durp\". It works!\r\n5. Click on *Change alert* button.\r\n6. Again click on *Alert* button\r\n\r\nh5. Expected Result\r\nIt should log a console message \"durp durp durp\". Not an alert anymore.\r\nIt's the behariour in 3.4.1 GA\r\n\r\nh5. Actual Result\r\nIt produce alert message.", "attachment": [], "flagged": false, "summary": "iOS: JavaScript function overriding doesn't work", "creator": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Titanium SDK: 3.5.0.v20150106150919\r\nAppc-Studio: 3.4.1 GA\r\nTitanium CLI: 3.4.1 GA\r\nAlloy : 1.5.1 GA\r\nXcode : 6.1\r\nOS: OSX 10.10.1\r\nDevice : iPhone 6plus (iOS 8.1)", "comment": { "comments": [ { "id": "338196", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please locate/paste the origin of this test case?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-07T19:00:28.000+0000", "updated": "2015-01-07T19:00:28.000+0000" }, { "id": "338309", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Note, to workaround this issue, you can add something like this from Fokke (http://www.tidev.io/2014/03/17/snippet-for-a-better-alert/ ):\r\n{code}\r\nfunction alert(message, title, ok) {\r\n Ti.UI.createAlertDialog({\r\n message: message,\r\n title: title || L('alert_title', 'Alert'),\r\n ok: ok || L('alert_ok', 'OK')\r\n }).show();\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-08T01:29:22.000+0000", "updated": "2015-01-08T01:31:32.000+0000" }, { "id": "338320", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "body": "This test case is originated from the ticket TIMOB-6572.", "updateAuthor": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-01-08T03:33:35.000+0000", "updated": "2015-01-08T03:33:35.000+0000" }, { "id": "338747", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving issue as \"won't fix\". Looking at the source code I verified that we made \"alert\", and other global variables, not-deletable and read-only. The fact that in an earlier version of Titanium they could be overwritten is that it was a bug in our JavaScriptCore. This has now been fixed and this issue is no longer valid.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-12T22:24:44.000+0000", "updated": "2015-01-12T22:24:44.000+0000" }, { "id": "338836", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Can't we generate any warning or error messages at this situation?", "updateAuthor": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-01-13T06:18:27.000+0000", "updated": "2015-01-13T06:18:27.000+0000" }, { "id": "415476", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as Won't Fix with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T22:38:51.000+0000", "updated": "2017-03-23T22:38:51.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }