Closed Bug 1516941 Opened 6 years ago Closed 5 years ago

Debugger isn’t pausing for debugger statements or exceptions in eval() code

Categories

(DevTools :: Debugger, defect, P3)

66 Branch
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: me, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

Use this HTML:

    <script>eval(`
        debugger
        throw new Error
    `)</script>

(Something very similar is at https://temp.chrismorgan.info/exception.html.)

1. Open the Debugger tab of the dev tools.
2. Ensure “Pause on exceptions” is turned on.
3. Reload the page.


Actual results:

1. The `debugger` statement is ignored.
2. The exception does not cause the debugger to pause.


Expected results:

1. The `debugger` statement should have made the debugger pause.
2. The exception should have caused the debugger to pause.


This supersedes bug 1512920 which was for the same bug but I incorrectly closed it have incorrectly thought it had been fixed. It seems to be specifically eval() code that is affected.
Hmm, looks like it may actually be a bit more nuanced after all. If I load the page in a new tab, then open the dev tools, then reload, it works; but then if I reload it again, it doesn’t work. Close and reopen the dev tools, and so long as the debugger tab isn’t open, it will work—but if it opens to the debugger tab, it won’t.
Has STR: --- → yes
Component: Untriaged → Debugger
Product: Firefox → DevTools
I can't seem to reproduce this. 

Could you clarify the intermittent behavior you mentioned? If you reload with the devtools open, it pauses the first time, but not the second? Can you see any errors in the Browser Console (Web Developer => Browser Console)?
Flags: needinfo?(me)
I think the behaviour is dependent on whether the Debugger pane of the dev tools has been loaded. (With closing the dev tools unloading it.) Thus, if you open the dev tools on the Console pane, the first run through will stop at the breakpoint as it should, but not after a subsequent reload, unless you (a) switch to another pane than Debugger, and close and reopen the dev tools, or (b) close the dev tools and reopen on another pane via the menu or particular keyboard shortcuts.

Nothing interesting in the Browser Console.
Flags: needinfo?(me)
Priority: -- → P3

I was able to reproduce the issue:

STR:

  1. Open the console, type "debugger;"
  2. (Watch DevTools switch over to the debugger and pause)
  3. Refresh the page
  4. Switch back to console pane, type "debugger;"
  5. Nothing happens...no pause, no panel change to the debugger
Priority: P3 → --
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713

I can no longer reproduce this -- the debugger pauses as it should :)

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.