Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1370] Alloy: Alloy/studio disregards variables that are not being used.

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.2.0
Fix Version/sn/a
Componentsn/a
Labelsdebugger-ios
ReporterAngel Petkov
AssigneeUnknown
Created2015-05-11T21:17:57.000+0000
Updated2018-04-08T20:58:29.000+0000

Description

When a breakpoint gets hit, if at the end of that function you step-into, the next JS function will make the debugger stop. To reproduce:

Create an Alloy app

Copy the following code into index.js:

function doClick(e) {
    alert($.label.text);
    Ti.API.info("Testing Debug");
}

$.index.open();

function onInterval() {
	var a = 1;
	var b = 3;
	var c = a + b;
}

// call every 4 seconds;
setInterval(onInterval, 4000);
#Set a breakpoint at line 8 and try to step in too. Actual result: The debugger stops at the onInterval function Expected result The debugger should not stop at the onInterval function Studio removes any variables that are not being used like a b and c in the snippet above. Maybe we could disabled this when in debugging an app as oppose to running it. When debugging the users will most likely want to see un-used variables they are using strictly for testing purposes. If its not too much work , maybe we can consider this improvement/new feature. Thanks!

Comments

  1. Wilson Luu 2015-12-01

    I can still reproduce this issue 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)

JSON Source