Why do my checkpoints run from my destination

I experience the behavior of breakpoints moving to the end of a file in Firefox Developer Edition when trying to set them anywhere in javascript.

enter image description here

Sometimes after rebooting the PC or the next day it works, but I'm not sure if any code leads to this problem or is it a bug in Firefox Developer Edition.

+5
source share
4 answers

When you set a breakpoint on a line that does not contain executable code, the debugger tries to be useful and shifts the breakpoint to the next closest line that it can find with executable code on it. It is not as simple as it seems, because it can set breakpoints on scripts that have already been collected in garbage, so the debugger cannot always determine whether a line contains non-executable code or just the corresponding script garbage collection.

The problem is even more complicated when using source maps, since the debugger needs to figure out which lines in the source source match the line in the generated source on which you set the breakpoint. The way we do this at present is not always accurate, which can lead to problems like the one you see.

However, there are other things that could explain why your breakpoints do not work as they should. For example, we also need to map breakpoints to byte offsets, which is also not always true.

We are actively reorganizing the breakpoint code in the debugger at the moment in an attempt to solve these problems, so I won’t be surprised if you click regression. It would be best to write a bugzilla bug for this problem, ideally with steps to reproduce.

Hope this helps!

+2
source

Install firebug after that, it will ask you to switch to the alpha version, accept the update, now you can put the breakpoint on the desired line.

Sincerely.

0
source

I just ran into this, and the problem was that I had a syntax error in the code in question.

As soon as I took out the intruder "====", I managed to set breakpoints in this section of the code.

0
source

DO NOT INTERRUPT LINES

My solution was to remove the extra lines in the variable so that everything was on the same line

Invalid syntax:

var inner_html = '<a> <div class="list_autocomplete"> <div class="image_autocomplete"> <img src="'+ img_url + '"> </div> <div class="label_autocomplete">' + item.label + '</div> <div class="description_autocomplete">' + item.description + '</div> </div> </a>'; 

The correct syntax is:

 var inner_html = '<a><div class="list_item_container"><div class="image"><img src="img/' + item.image + '"></div><div class="label">' + item.label + '</div><div class="description">' + item.description + '</div></div></a>'; 
0
source

Source: https://habr.com/ru/post/1212525/


All Articles