Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4158] Debugger: Variable pane is returning 'undefined' instead of null

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2016-03-16T17:25:23.000+0000
Affected Version/sRelease 1.7.0, Release 5.1.1
Fix Version/sn/a
ComponentsAndroid, iOS
Labelsdebugger, null, undefined
ReporterNatalie Huynh
AssigneeIngo Muschenetz
Created2011-05-20T11:06:15.000+0000
Updated2017-03-20T17:20:57.000+0000

Description

*Steps to reproduce:*

Create a Titanium classic app

In the app.js file, replace the code with the following:

var win = Ti.UI.createWindow({
	backgroundColor: 'white',
	layout: 'vertical'
});

var f = function() {
	var foo = "a";
	Ti.API.info("Inside anonymous function: "+foo);
	Ti.API.info("Global val: "+x);
	x+=1;
};

var b1 = Ti.UI.createButton({
	title:'Anonymous f/g',
	top:20
});

b1.addEventListener('click', function(e) {
	f();
	var g = f;
	g();
});

win.add(b1);
win.open();

Add a breakpoint on line 7

Debug app to iOS simulator or Android emulator

After the app is launched, press the "Anonymous f/g" button

Breakpoint should be triggered

*Actual:* In Studio's debugger variables pane, foo is set to undefined; see attachment. *Expected:* According to test case 1013, step 9, in https://wiki.appcelerator.org/display/tp/Debugger+Test+Plan, foo should be set to null.

Attachments

FileDateSize
Screen Shot 2015-11-30 at 5.51.56 PM.png2015-12-01T01:58:41.000+000032648

Comments

  1. Wilson Luu 2015-12-01

    I can reproduce this issue with current GA stack on both Android and iOS. Tested on: Appcelerator Studio, build: 4.4.0.201511241829 Appc CLI NPM: 4.2.2 Appc CLI Core: 5.1.0 Arrow: 1.3.22 SDK: 5.1.1.GA Node: v4.2.2 OS: El Capitan (10.11.1) Xcode: 7.1.1 Devices: iphone 6 simulator (9.1), genymotion emulator (4.4.4)
  2. Angel Petkov 2016-03-15

    When you're at line 7 foo is undefined. It should return null if you added
    var foo;
    at line 6.However you are defining and assigning the value at line 7 as far as the compiler is concerned. When the debugger is at line 7, it means the last command executed was 6 and 7 is the next line to be executed.
  3. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source