You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging, trying to STEP-IN to a generator function call causes the debugger session to CONTINUE.
This is inconsistent when...
STEP-IN on a regular function call triggers STEP-IN (steps to first line in the called function)
STEP-IN on a NON-function-call triggers STEP-OVER (steps to next line in the current function)
STEP-IN on a NON-function-call at the end of a function triggers STEP-OUT (steps to a line following the original function-call)
The above three seem to me to be correct behaviour, consistent with using STEP-IN as a shortcut for go-to-the-next-line-of-code.
This inconsistency is a particular problem because it is impossible to judge from the interactive debugger session whether the apparent function call you are stepping into is a generator or a regular function. Therefore you might try to STEP-IN, then find that the debugger has chosen to CONTINUE because it was a generator call, making that stack call in the debugger session unrecoverable unless you had another breakpoint to catch it. The only workaround is to have a 100% accurate model of which calls are generators and Never call STEP-IN on a generator call.
Taking the below example, assuming just two manually-inserted Debugger breakpoints.
One at run()
One at: console.log("Finished script"). This is jumped to if you hit CONTINUE at any time.
Pressing the STEP-IN control in Chrome Inspector or VSCode ...
STEP-IN on run() triggers STEP-IN
STEP-IN on const nothing = makeNothing() triggers STEP-IN
STEP-IN on functionRunning = makeNothing.name triggers STEP-OVER
STEP-IN on return triggers STEP-OUT
STEP-IN on const sequence = makeSequence(5) then surprisingly triggers CONTINUE - jumping to the next manually-inserted breakpoint at console.log("Finished script") instead of the expected behaviour - stepping over to the line console.log("Arbitrary logging")
When debugging, trying to STEP-IN to a generator function call causes the debugger session to CONTINUE.
This is inconsistent when...
The above three seem to me to be correct behaviour, consistent with using STEP-IN as a shortcut for go-to-the-next-line-of-code.
This inconsistency is a particular problem because it is impossible to judge from the interactive debugger session whether the apparent function call you are stepping into is a generator or a regular function. Therefore you might try to STEP-IN, then find that the debugger has chosen to CONTINUE because it was a generator call, making that stack call in the debugger session unrecoverable unless you had another breakpoint to catch it. The only workaround is to have a 100% accurate model of which calls are generators and Never call STEP-IN on a generator call.
Taking the below example, assuming just two manually-inserted Debugger breakpoints.
run()
console.log("Finished script")
. This is jumped to if you hit CONTINUE at any time.Pressing the STEP-IN control in Chrome Inspector or VSCode ...
run()
triggers STEP-INconst nothing = makeNothing()
triggers STEP-INfunctionRunning = makeNothing.name
triggers STEP-OVERreturn
triggers STEP-OUTconst sequence = makeSequence(5)
then surprisingly triggers CONTINUE - jumping to the next manually-inserted breakpoint atconsole.log("Finished script")
instead of the expected behaviour - stepping over to the lineconsole.log("Arbitrary logging")
The text was updated successfully, but these errors were encountered: