if and else condition executed when stepping through code

UNCONFIRMED
Assigned to

Status

Other Applications
Venkman JS Debugger
UNCONFIRMED
11 years ago
7 years ago

People

(Reporter: ttopwells, Assigned: Robert Ginda)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Build Identifier: 0.9.87

See steps to reproduce below.

Reproducible: Always

Steps to Reproduce:
While single-stepping through code in the debugger, step through a condition like this:
if (true) {
 var foo;
 foo = 1;
} else {
 var bar;
 bar = 2;
}

and the debugger will step through both the true expression and the else expression.  

However, if the code looks like this:

var foo;
var bar;
if (true){
 foo = 1;
} else {
 bar = 2;
}

then only the true condition will be executed (as expected).  Of course this is tremendously confusing when stepping through code.
Actual Results:  
both true and else condition are executed.

Expected Results:  
only true condition should be executed.
I think you're seeing fallout from bug 156861 - the line you're actually executing is correct, but you're seeing the wrong line. 
(Reporter)

Comment 2

11 years ago
So you are saying that when the debugger shows me executing both lines of the else condition, it is actually executing some other 2 lines of code?

Comment 3

7 years ago
This is WFM for me on current (SeaMonkey) trunk.
(In reply to comment #3)
> This is WFM for me on current (SeaMonkey) trunk.

Without having tested this, maybe it depends on the JS engine (TraceMonkey/JIT)?
You need to log in before you can comment on or make changes to this bug.