Debugger focuses wrong line when looking for event handler
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Gijs, Unassigned)
References
Details
Attachments
(1 file)
58.24 KB,
image/png
|
Details |
STR:
- yesterday's (March 3, 2019) nightly, mac
- open gmail and log in.
- open inspector
- click {event} bubble on <body> . Expand the 'click' event and note the source code of the handler.
- click the "go to this in the debugger" button
- stare in confusion at the minified JS, and click "pretty print" button in the bottom left hand corner
- lose your place, so go back to inspector, repeat step 3/4 (I'm assuming this is already on file elsewhere).
ER:
You get to the source code of the handler;
AR:
you end up at:
b.addEventListener(c.toString(), e, f);
which is the addEventListener call.
The actual handler lives a little lower down, in the pUa
minified function that looks like this:
pUa = function () {
var b = rUa,
c = JTa ? function (d) {
return b.call(c.src, c.listener, d)
}
: function (d) {
d = b.call(c.src, c.listener, d);
if (!d) return d
};
return c
},
Comment 1•6 years ago
|
||
The issue here is that the console doesn't actually tell the debugger what column to jump to, just what line, and the start of that line happens to be b.addEventListener(c.toString(), e, f);
while b.call(c.src, c.listener, d)
is later on the line.
Relevant code: https://hg.mozilla.org/mozilla-central/file/c89f024c023f/devtools/server/actors/inspector/event-collector.js#l901
We have several bugs along these lines, but I'm not duping them because they may actually be separate instances of related problems.
Updated•6 years ago
|
Comment 2•6 years ago
|
||
Simplified test case: https://debugger-pretty-print-events-1532240.glitch.me/
STR:
- Pretty print
compressed.js
in Debugger (click through via console log) - In Inspector find the
click
event on thebody
element - Navigate to Debugger via event handler location
Alternative STR:
- Inspect
body
element to find the click event fromcompressed.js
- Pretty print
compressed.js
AR: Wrong line (setup
declaration) is focused (compressed.js:formatted:7
)
ER: myEventHandler
declaration is focused
Logan, does it seem reasonable to treat the both STRs as the same bug. That the column information is missing, probably affects both cases.
Comment 3•6 years ago
|
||
Closing in favor of bug 1394998 as it has some technical discussion and focuses on the location issue.
Description
•