3

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.

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. 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 3

6

I 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:

Screencast how to skip code from breaking location to later line

The same option is available in the Firefox dev tools.

1

As Ivar mentioned in the comments, 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.

demo

See Step through code to learn more about each of the code stepping buttons.

0
0
  1. Add a breakpoint to the f1() line.
  2. Comment it out /* f1() */ and press CMD + S to save.
  3. Press play

This way the function call will be commented out.

2
  • 1
    read the commend in the example again, please. I edited it to avoid confusion.
    – Stav Alfi
    Commented Dec 22, 2018 at 15:35
  • 1
    If you are saying you don't want to go over it, you are saying you want to go inside? Because these are the only ways you can go. Commented Dec 22, 2018 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.