Stepping through an if (false) { ... } block makes it look like the last statement of the block is executed

RESOLVED DUPLICATE of bug 1003554

Status

RESOLVED DUPLICATE of bug 1003554
4 years ago
4 months ago

People

(Reporter: peter.kehl, Unassigned)

Tracking

33 Branch
x86_64
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

308 bytes, application/vnd.mozilla.xul+xml
Details
(Reporter)

Description

4 years ago
Created attachment 8532716 [details]
test.xul

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0
Build ID: 20141113113219

Steps to reproduce:

Use Browser TooBox to run an .xul or similar. Have Javascript:

if( false ) {
   some code one one or more separate lines....
}

See the attached test.xul.

Debug that part of the code from line 'if(false) {' by Stepping over (F10).


Actual results:

After you press button Step Over (F10) at line 'if(false) {', debugger moves to the last line of the if() {...} block. The current execution line indicator  looks as if it were about to execute that last line of the code. This may be less confusing when you have multiple lines in the {...} block, but it's highly confusing if there is just one line.

Then press Step Over (F10) again. The current execution line indicator doesn't move. It moves only on the next Step Over (F10). Again, confusing.


Expected results:

It should go to the line where there's the next command after the enclosing '}'.

This may be remotely related to issue #1051632.
(Reporter)

Updated

4 years ago
Component: Untriaged → Developer Tools
Component: Developer Tools → Developer Tools: Debugger
This bug looks similar to though not quite the same as bug 1052738.

Updated

4 years ago
Summary: When debugging by steps in Browser ToolBox, if(false) looks like it runs the last command of its block → Stepping through an if (false) { ... } block makes it look like the last statement of the block is executed

Comment 2

4 years ago
This is fixed by the patch for bug 1003554.
The underlying problem is that a compiler-generated instruction
is given a misleading line number.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1003554

Updated

4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.