Closed Bug 1108153 Opened 10 years ago Closed 9 years ago

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

Categories

(DevTools :: Debugger, defect)

33 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1003554

People

(Reporter: peter.kehl, Unassigned)

Details

Attachments

(1 file)

308 bytes, application/vnd.mozilla.xul+xml
Details
Attached file 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.
Component: Untriaged → Developer Tools
Component: Developer Tools → Developer Tools: Debugger
This bug looks similar to though not quite the same as bug 1052738.
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
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
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: