[TIMOB-7019] Android: Ti.Include blocks global variable.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-02-14T23:29:00.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 2.0.0 |
Fix Version/s | Sprint 2012-03, Release 2.0.0, Release 1.8.2 |
Components | Android |
Labels | module_include, parity, qe-testadded |
Reporter | Qing Gao |
Assignee | Josh Roesslein |
Created | 2012-01-06T11:04:41.000+0000 |
Updated | 2012-03-03T23:11:24.000+0000 |
Description
Ti.include blocks global variables incorrectly.
Repro Steps:
Create a project to include the code below.
//app.js
var win = Ti.UI.createWindow();
var headerView = Ti.UI.createView();
Ti.include('test2.js');
win.add(headerView);
win.open();
//test2.js
var otherView = Ti.UI.createView();
headerView.add(otherView);
Attachments
File | Date | Size |
---|---|---|
TestCase.zip | 2012-01-31T15:51:04.000+0000 | 1890 |
I am not noticing any issues after correcting that code. None of the views will be visible as is. Giving them background color and some width & height does. I also declared a variable in my app.js and was able to access it just fine in the included file. Can you verify this with a recent CI build and if your issue is still present can you document the behavior you see and what you expect.
I think I am having the same problem as the creator of this ticket. I have reported this, with a code example, in Helpdesk: http://support.appcelerator.com/tickets/APP-553113 The issue remains in the latest master CI-build.
This test case should show an alert message. Verifies the global scope is accessible from an included file.
Unable to reproduce this issue anymore with Rhino runtime.
[Pull Request #1317](https://github.com/appcelerator/titanium_mobile/pull/1317)
Cannot verify bug fix until FastDev works with blank Ti.include files. TIMOB-7552.
Closing as Fixed. SDK: 1.9.0.v20120207171634 Android: V8/Rhino Studio: 1.0.8.201201262211 OS: Lion Devices Tested: Droid3 2.3.4, Xoom 3.2.1 Note: Cannot be tested on the emulator due to linked FastDev issue.