For example:
const x = 10
const f1 = () => {/* do something... */}
f1() // <<-- I'm here
console.log(x) // I want to go here without entring to f1 AT ALL but still let f1 execute.
I want to let f1
execute but I don't want to go over it.
Is it possible?
No duplication:
The other question is for finding a way to prevent any line from executing while this question is about letting lines that the only function calls execute but without the debugger to step into their execution.
For example:
const x = 10
const f1 = () => {/* do something... */}
f1() // <<-- I'm here
console.log(x) // I want to go here without entring to f1 AT ALL but still let f1 execute.
I want to let f1
execute but I don't want to go over it.
Is it possible?
No duplication:
The other question is for finding a way to prevent any line from executing while this question is about letting lines that the only function calls execute but without the debugger to step into their execution.
Share Improve this question edited Dec 22, 2018 at 15:36 Stav Alfi asked Dec 22, 2018 at 14:52 Stav AlfiStav Alfi 14k27 gold badges108 silver badges197 bronze badges 9- Hard to prove a negative, but I don't think Chrome's devtools have that feature (yet). I've wanted it more than once. – T.J. Crowder Commented Dec 22, 2018 at 14:56
- @Ivar It's not. The link you provide is for finding a way to prevent any line from executing while this question is about letting lines that only function calls execute but without the debugger to step into their execution. – Stav Alfi Commented Dec 22, 2018 at 15:25
- @Ivar please remove the duplication or response. – Stav Alfi Commented Dec 22, 2018 at 15:28
- F8 aka Step Next does exactly what you are asking for – skyboyer Commented Dec 22, 2018 at 15:29
-
2
@StavAlfi I'm not sure why that would need 150 breakpoints. When you are paused on
f1()
you just either hit the "Step Over" button or add a breakpoint on the line below, hit "resume" and remove it again. If that does not do what you want then it might be useful to elaborate a bit more on your workflow. – Ivar Commented Dec 22, 2018 at 15:34
3 Answers
Reset to default 6I want to let f1 execute but I don't want to go over it.
I assume you don't want to prevent Chrome from running f1()
but just not having to step over it line by line.
If you want to step over multiple lines "Continue to here" from the context menu on the editor's ruler seems to be the best option:
The same option is available in the Firefox dev tools.
As Ivar mentioned in the ments, the Step Over button does exactly what you want.
In the GIF below you can see that I'm paused on doStuff()
. I haven't executed it yet. After clicking Step Over I'm paused on the line of code below doStuff()
. The three console.log()
statements defined within doStuff()
have been logged to the Console. Therefore, the doStuff()
function has executed without you needing to step through every single line of the function.
See Step through code to learn more about each of the code stepping buttons.
- Add a breakpoint to the
f1()
line. - Comment it out
/* f1() */
and pressCMD + S
to save. - Press play
This way the function call will be mented out.