Is there a way to skip jQuery / Backbone / Underscore code when navigating through JS using a debugger?

When using the Chrome debugger to execute code in my JS applications, I often find myself in firmware mode through the spine / underscore / jQuery code, which I am not interested in. Anyway, to get through my code, but do you have any missing debugger code that is part of these libraries?

+6
source share
2 answers

I just spent three days living inside a chrome debugger doing just that.

The trick is to set a breakpoint and the next line after the Backbone / jQuery / Underscore and F8 code when you get there.

how

for(_(obj).each(function(v,k,l){ console.log( k,v,l); }); 

Set breakpoints on the for line and console line. F11 to the for line, then F8, and then continue with your step.

It’s a little painful to set up, but since switching breakpoints is easier than setting them at the initial stage, when you set it up for serviceability.

+3
source

In most debuggers, you have an "exit" (of the current function), so you can use it when you go to the highest levels of libraries that you want to skip.

EDIT: Btw, the output goes from the current location to the original state of the current function. I have not used too many debuggers, so I can’t say what happens if you exit a function with asynchronous calls in it. I can only imagine that it will exit the function and the asynchronous call will continue when you go to something else.

+2
source

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


All Articles