Open Bug 1583065 Opened 5 years ago Updated 2 years ago

Sources with parse errors are not shown in Debugger

Categories

(DevTools :: Debugger, enhancement, P2)

enhancement

Tracking

(Not tracked)

People

(Reporter: Harald, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [dt-q])

Attachments

(2 files)

What were you doing?

  1. Load a source with syntax error: https://hilarious-gourd.glitch.me/
  2. Click syntax error in Console

What happened?

Source opens in tab.

What should have happened?

Should open in Debugger.

In order to fix this, we need to be able to generate sources in the debugger when parsing produces an error and no resulting script. Right now the debugger assumes that sources all contain scripts, e.g. it adds sources in response to notifications about new scripts. Fixing this shouldn't be complicated, just making some adjustments to the hooks used to listen for new scripts/sources. The tricky part is deciding what to do when the page is loaded before the devtools are open. In that case parse errors in a source will cause the error to be reported and the source contents to be discarded. We want those contents to be retained, though, in case the debugger is opened later. It's probably sufficient to generate a new source in spidermonkey and hang onto it until the next compacting GC (like we do with the URLs of visited websites, bug 1572596). In that case opening the debugger soon after page load will usually allow the debugger to find the sources which contain errors, and in any case reloading with the devtools open will always let the debugger find them.

Whiteboard: [dt-q]

Discussed again today that we should get around to this soon.

Priority: P3 → P2
Severity: normal → S3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: