MCPcopy Index your code
hub / github.com/nodejs/node / setupPrepareStackTrace

Function setupPrepareStackTrace

lib/internal/bootstrap/realm.js:452–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

450}
451
452function setupPrepareStackTrace() {
453 const {
454 setEnhanceStackForFatalException,
455 setPrepareStackTraceCallback,
456 } = internalBinding('errors');
457 const {
458 prepareStackTraceCallback,
459 ErrorPrepareStackTrace,
460 fatalExceptionStackEnhancers: {
461 beforeInspector,
462 afterInspector,
463 },
464 } = requireBuiltin('internal/errors');
465 // Tell our PrepareStackTraceCallback passed to the V8 API
466 // to call prepareStackTrace().
467 setPrepareStackTraceCallback(prepareStackTraceCallback);
468 // Set the function used to enhance the error stack for printing
469 setEnhanceStackForFatalException(beforeInspector, afterInspector);
470 // Setup the default Error.prepareStackTrace.
471 ObjectDefineProperty(Error, 'prepareStackTrace', {
472 __proto__: null,
473 writable: true,
474 enumerable: false,
475 configurable: true,
476 value: ErrorPrepareStackTrace,
477 });
478}
479
480// Store the internal loaders in C++.
481setInternalLoaders(internalBinding, requireBuiltin);

Callers 1

realm.jsFile · 0.85

Calls 1

requireBuiltinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…