Closed Bug 1435524 Opened 8 years ago Closed 8 years ago

Inconsistent behaviour when setting breakpoints at the start of "if" expressions

Categories

(Firefox :: Untriaged, defect)

58 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1435519

People

(Reporter: hbenl, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0 Build ID: 20180130084414 Steps to reproduce: I'm trying to set a breakpoint at the first line of the following statement: if (true) { console.log("Foo! Bar!"); } Actual results: Depending on the context of that statement the breakpoint is either set on the first line or is moved to the second line (to the console.log statement). Expected results: The breakpoint should always be set at the first line
Here's an example: // Breakpoint is moved if (true) { console.log("Foo! Bar!"); } // Breakpoint is moved function f1() { if (true) { console.log("Foo! Bar!"); } } // Breakpoint is *not* moved function f2() { if (true) { console.log("Foo! Bar!"); } let x; } // Breakpoint is moved function f3() { if (true) { console.log("Foo! Bar!"); } var x; }
Correction: in the first part of the example, the breakpoint is not moved in the Firefox devtools, but it is moved when I use the VS Code debug adapter for Firefox (https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug) with Firefox 58.0.1, but not with Firefox 59.0b6. This may also be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1435519
I think that this issue is very similar as the one filed in bug 1435519, so I'm marking this one as Resolved-Duplicated.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.