Breakpoints of assigned functions aren't hit
Categories
(DevTools :: Debugger, defect)
Tracking
(Not tracked)
People
(Reporter: ochameau, Unassigned)
Details
Attachments
(3 files, 1 obsolete file)
When setting a breakpoint on such line:
window.onclick = {document.body.innerHTML+="x";};
we used to only break when clicking on the page.
Now, we do break only on page load and no longer when clicking on the page.
This seems to have changed in a less than 10 days as I think I was having the old behavior I can now see on release builds on a somewhat recent nightly.
Here is a test document:
data:text/html,<script>window.onclick=()=>{document.body.innerHTML+="x";};</script>
Now, we do have to introduce a newline in order to be able to break on the innerHTML code.
Comment 1•5 years ago
|
||
Thanks for the report Alex.
I can't reproduce the issue. Here is what I am doing:
- Open DevTools and select the Debugger panel
- Load
data:text/html,<script>window.onclick=()=>{document.body.innerHTML+="x";};</script>
- Create a breakpoint on line 1
- Reload the page, the BP should not hit
- Click on the page, the BP should hit
Steps #3 and #4 are working as described for me (Nightly + Win10).
What am I doing wrong?
Honza
Reporter | ||
Comment 2•5 years ago
|
||
I do not reproduce your STR from comment 1 and still reproduces mine.
I'm testing against Nightly 70.0a1 (2019-08-05) (64 bits) on Windows.
If I test on a local build, with very lastest m-c changeset, on Linux, I hit bug 1571721 constantly and that doesn't allow me to even try to reproduce this STR.
Comment 3•5 years ago
|
||
Note that Col BP needs to be properly set
See the attached screenshot:
- If the second col BP is set - the script breaks on click
- If the first col BP is set - the script breaks on reload
Honza
Reporter | ||
Comment 4•5 years ago
|
||
Ah ok. It works fine if I set the breakpoint on the right column.
But it highlights some randomness in:
- how many column breakpoint are displayed,
- and because of that, the finaly breakpoint being set by default when cliking on the line number.
It looks like there is a race or some random behavior for some reason.
See the two following screenshots from the same firefox instance against the exact same URI, but loaded in two distinct tabs.
Reporter | ||
Comment 5•5 years ago
|
||
Reporter | ||
Comment 6•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
- 2 vs 4 column breakpoints is related to a GC sensitive api we use (https://bugzilla.mozilla.org/show_bug.cgi?id=1532844)
Comment 9•5 years ago
|
||
I am marking this as dup since the GC issue will be solved by bug 1572280
Honza
Description
•