Let's say I have a JS script like the following:
function recurse() {
return recurse();
}
recurse();
If I run node recurse.js, it will of course fail with a "Maximum call stack size exceeded" error.
How do I get a debugger (for example, running in VS Code) to break before this exception happens, so I can see what's in the stack? I can attach a breakpoint, but it would take forever to hit this exception.