Skip to content

process: split routines used to enhance fatal exception stack traces

Previously the enhancement were done right after emitting 'uncaughtException', which meant by the time we knew the exception was fatal in C++, the error.stack had already been patched.

This patch moves those routines to be called later during the fatal exception handling, and split them into two stages: before and after the inspector is notified by the invocation of V8Inspector::exceptionThrown. We now expand the stack to include additional informations about unhandled 'error' events before the inspector is notified, but delay the highlighting of the frames until after the inspector is notified, so that the ANSI escape sequences won't show up in the inspector console.

Fixes: https://github.com/nodejs/node/issues/28287

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading