Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13586] Debugger: Android and iOS different behavior when setting a breakpoint on a function declaration

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.2, Release 3.1.0
Fix Version/sn/a
ComponentsTooling
Labelsqe-3.1.0, usability
ReporterFederico Casali
AssigneeChris Barber
Created2013-04-16T01:50:30.000+0000
Updated2015-04-13T17:07:11.000+0000

Description

Problem description

Android and iOS behave in a different way when setting breakpoints on function declaration. See sample code:
var win = Ti.UI.createWindow({
	backgroundColor:'blue'
});

function test(){
	alert('foobar');
};

var view = Ti.UI.createView({
	height:200,
	width:200,
	backgroundColor:'orange'
});
view.addEventListener('click', function(){
	test();
});

win.add(view);
win.open();
If a breakpoint is set on line 5 ( function test(){ ) , on Android it actually breaks at line 6 after triggering the 'click' event on the view. On iOS it breaks on line 5. If setting breakpoints for both lines 5 and 6, on Android it only breaks once at line 6, while on iOS it breaks for both. If setting breakpoints both on line 6, it works correctly as expected for both the platforms.

Comments

No comments

JSON Source