Skip to content

src,lib: fix assert when `Error.prepareStackTrace` not overridden

Refs https://github.com/nodejs/node/pull/23926

Fixes an issue caused when embedders choose to set up the v8::Isolate without a prepareStackTrace callback. In this event, several assert methods stop working because stack trace formatting relies on a SafeWeakMap that's only populated in the overridden prepareStackTrace callback.

Fix this by exposing override status under getEmbedderOptions and falling back to the default implementation of Error.prepareStackTrace if it's not been overridden.

Merge request reports

Loading