[TIMOB-4158] Debugger: Variable pane is returning 'undefined' instead of null
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-03-16T17:25:23.000+0000 |
Affected Version/s | Release 1.7.0, Release 5.1.1 |
Fix Version/s | n/a |
Components | Android, iOS |
Labels | debugger, null, undefined |
Reporter | Natalie Huynh |
Assignee | Ingo Muschenetz |
Created | 2011-05-20T11:06:15.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
Screen Shot 2015-11-30 at 5.51.56 PM.png | 2015-12-01T01:58:41.000+0000 | 32648 |
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)
When you're at line 7 foo is undefined. It should return null if you added
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.
Closing ticket as invalid.