{ "id": "134206", "key": "TIMOB-17457", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-09-18T19:19:38.000+0000", "created": "2014-08-05T23:55:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.4.0" ], "versions": [ { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T17:10:25.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Details:* JS global object is undefined after calling Ti.App.addEventListener.\r\n\r\n*Note:*\r\n1. This does *not* occur on iOS\r\n2. This is not a regression with 3.2.3.GA\r\n\r\n*Steps to reproduce:*\r\n1. Create a classic Titanium app\r\n2. Download and unzip Archive.zip\r\n3. Copy all contents in the Archive folder and paste them in the Resources directory from step 1\r\n4. Next, install app to an Android device\r\n5. After app is installed, press \"Start Automation\" button\r\n\r\n*Actual:* After test is complete, \"Cannot read property\" runtime error appears (see runtime_error.png attachment).\r\n\r\nThe bug is in testExecutor.js on line 34.\r\n\r\n*Expected:* App should run without throwing a runtime error.", "attachment": [ { "id": "50257", "filename": "Archive.zip", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-05T23:55:37.000+0000", "size": 2884, "mimeType": "application/zip" }, { "id": "50256", "filename": "runtime_error.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-05T23:55:37.000+0000", "size": 124223, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: JS Global Object - JS global object is undefined after calling Ti.App.addEventListener", "creator": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Studio, build: 3.3.0.201407111535, 3.4.0.201408201526\r\nSDK build: 3.2.3.GA, 3.3.0.GA, 3.4.0.v20140820125714\r\nCLI: 3.3.0, 3.4.0-dev\r\nAlloy: 1.4.1, 1.5.0-dev\r\nDevices: Samsung Galaxy S4 (4.4.2), Nexus 5 (4.4.4)", "closedSprints": [ { "id": 219, "state": "closed", "name": "2014 Sprint 19 SDK", "startDate": "2014-09-18T21:06:27.559Z", "endDate": "2014-09-27T00:00:00.000Z", "completeDate": "2014-09-29T13:58:58.022Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "319457", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce\r\n\r\nTitanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA, 3.2.2.GA\r\nTitanium Studio, build: 3.3.0.201407100905\r\nTitanium Command-Line Interface\r\nCLI version 3.3.0, \r\nAndroid device : Motorola Moto G, Android version : 4.4.4", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-20T11:03:06.000+0000", "updated": "2014-08-20T11:03:06.000+0000" }, { "id": "319779", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening ticket since I can still reproduce the issue. \r\n\r\nI noticed that I was missing one more step in the bug description which was to press the \"Start Automation\" button. Will update the bug description.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-21T20:30:58.000+0000", "updated": "2014-08-21T20:30:58.000+0000" }, { "id": "324571", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In the event listener of Ti.App, \"this\" means the Ti.App object, not the \"global\". That's why this.textArea inside the event listener is undefined.\r\nSo \"testExecutor.js\" line 28-50 should be:\r\n{code}\r\nvar self = this;\r\nTi.App.addEventListener(doneEvent, function(evt) {\r\n Ti.API.info(\"this = \" + this);\r\n Ti.API.info(\"self = \" + self);\r\n \r\n var tests = evt[overallTestsKey];\r\n var passed = evt[overallPassKey];\r\n \r\n // Use self instead of this\r\n self.textArea.value +=\r\n \"Done! \\n\" + \r\n \"Total: \" + tests + \"\\n\" + \r\n \"Passed: \" + passed + \"\\n\\n\";\r\n // workAround.textArea.value +=\r\n // \"Done! \\n\" + \r\n // \"Total: \" + tests + \"\\n\" + \r\n // \"Passed: \" + passed + \"\\n\\n\";\r\n \r\n overallTests += tests;\r\n overallPass += passed;\r\n \r\n executeNextTest();\r\n});\r\n{code}\r\nResolved the ticket as Invalid.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-18T19:14:26.000+0000", "updated": "2014-09-18T19:14:26.000+0000" }, { "id": "415564", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T17:10:25.000+0000", "updated": "2017-03-24T17:10:25.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }