[TIMOB-17457] Android: JS Global Object - JS global object is undefined after calling Ti.App.addEventListener
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2014-09-18T19:19:38.000+0000 |
Affected Version/s | Release 3.2.3, Release 3.3.0 |
Fix Version/s | n/a |
Components | Android |
Labels | qe-3.4.0 |
Reporter | Wilson Luu |
Assignee | Ping Wang |
Created | 2014-08-05T23:55:37.000+0000 |
Updated | 2017-03-24T17:10:25.000+0000 |
Description
*Details:* JS global object is undefined after calling Ti.App.addEventListener.
*Note:*
1. This does *not* occur on iOS
2. This is not a regression with 3.2.3.GA
*Steps to reproduce:*
1. Create a classic Titanium app
2. Download and unzip Archive.zip
3. Copy all contents in the Archive folder and paste them in the Resources directory from step 1
4. Next, install app to an Android device
5. After app is installed, press "Start Automation" button
*Actual:* After test is complete, "Cannot read property" runtime error appears (see runtime_error.png attachment).
The bug is in testExecutor.js on line 34.
*Expected:* App should run without throwing a runtime error.
Attachments
Cannot reproduce Titanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA, 3.2.2.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
Reopening ticket since I can still reproduce the issue. I 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.
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. So "testExecutor.js" line 28-50 should be:
Resolved the ticket as Invalid.
Closing ticket as invalid with reference to the above comments.