Jumping from Inspector events to Debugger jumps to wrong line for pretty-printed sources
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox71 fixed)
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: minkul.alam, Assigned: zhaogangse)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
- Open this Glitch project https://mini-whippoorwill.glitch.me/
- Inspect the button
- Click the event listeners list icon
- From the event listeners list, click the 'open in debugger' arrow for custom script 'script.js' file.
- Pretty print source by clicking the prettifier button on bottom.
Actual results:
Debugger cannot point to exact line number, where the event is attached.
Expected results:
Like chromium devTools, Firefox devTools also should be able to point to exact line number on prettified source.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Thanks for filing a great report.
After some browsing and testing, I'd like to share some information for fixing the bug.
In our current code base, the problem is twofold:
-
Debugger only receives line location from the inspector. An additional column indicating the head of the listener is needed to be sent. This doesn't seem to be a problem on the debugger side.
-
Our pretty print has a bug that the highlight location isn't selected in the prettified version, though there exists code supposedly doing the job. This can be fixed by deleting
await dispatch(selectSource(cx, prettySource.id))
in prettyPrint.js:createPrettySource(), because this line cleared the current selected location as a side effect, and it's useless.
Now the event listener tooltip url in the inspector will have an additional column part for generated file, which will be parsed as location.column to debugger, and the debugger pretty print can correctly create and use source map.
Updated•5 years ago
|
Pushed by dwalsh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0762a641fec7 Pass event listener column to debugger for more accurate pretty print. r=davidwalsh
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Description
•