Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7019] Android: Ti.Include blocks global variable.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:00.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsAndroid
Labelsmodule_include, parity, qe-testadded
ReporterQing Gao
AssigneeJosh Roesslein
Created2012-01-06T11:04:41.000+0000
Updated2012-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

FileDateSize
TestCase.zip2012-01-31T15:51:04.000+00001890

Comments

  1. Josh Roesslein 2012-01-10

    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.
  2. Marcus Olovsson 2012-01-11

    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.
  3. Josh Roesslein 2012-01-31

    This test case should show an alert message. Verifies the global scope is accessible from an included file.
  4. Josh Roesslein 2012-01-31

    Unable to reproduce this issue anymore with Rhino runtime.
  5. Josh Roesslein 2012-01-31

    [Pull Request #1317](https://github.com/appcelerator/titanium_mobile/pull/1317)
  6. Dustin Hyde 2012-02-06

    Cannot verify bug fix until FastDev works with blank Ti.include files. TIMOB-7552.
  7. Dustin Hyde 2012-02-08

    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.

JSON Source