Reputation: 936
Currently, I have a script black boxed, but I still have to step through that code. It doesn't actually show the code, but I still have to press the button to step through it, which kind of defeats the purpose. I want to be able to just skip all blackboxed code and go directly to the code that isn't blackboxed, even if the blackboxed code calls non-blackboxed code...so, I don't want to just step over the blackboxed code, but I don't want to step through each individual step in the black boxed code to get to the non black boxed code...is this possible?
Upvotes: 1
Views: 671
Reputation: 24028
If you black-box a script, the debugger doesn't step into the script file at all. You shouldn't have to keep stepping through code inside it. If you are, then either it's a source mapping issue, which I've seen before, or you specifically put breakpoints in the black-boxed script. See further down.
For example, take scripts A, B and C. B calls some function in C, A calls a function in B, but B is black-boxed. You pause on the A call, you step into the function, but instead of the debugger going into B's function, you'll end up in C's function straight away. You can try it with the following:
Main page
<script src="c.js"></script>
<script src="b.js"></script>
<script src="a.js"></script>
a.js
window.bFunc();
b.js
window.bFunc = function() {
window.cFunc();
}
b.js
window.cFunc = function() {
console.log('called cFunc');
}
If you put breakpoints in the blackboxed script (e.g. B in this case), it will break on them, but not step into the code. Obviously, you can disable those breakpoints to continue stepping into other code. The important thing is that these breakpoints YOU explicitly put there, so you control that.
If there's particular behaviour you are not keen on, or have suggestions, post a comment in the DevTools: New blackbox implementation Chromium thread. The last comment discuses the point above and the benefit of the debugger not ignoring the blackboxed breakpoints.
Upvotes: 1