lib/full_stack.js
function prepareStackTrace( error, structuredStackTrace ) {
  // If error already have a cached trace inside, just return that
  // happens on true errors most
  if ( error.__cachedTrace ) { return error.__cachedTrace; }

  const stackTrace = utils.createStackTrace( error, structuredStackTrace );
  error.__cachedTrace = utils.removeInternalFrames( filename, stackTrace );

  if ( !error.__previous ) {
    let previousTraceError = currentTraceError;
    while ( previousTraceError ) {
      const previousTrace = utils.removeInternalFrames( filename, previousTraceError.stack );
      // append old stack trace to the "cachedTrace"
      error.__cachedTrace += `${utils.separator}${utils.breakLn}${previousTraceError.__location}\n`;
      error.__cachedTrace += previousTrace.substring( previousTrace.indexOf( '\n' ) + 1 );

      previousTraceError = previousTraceError.__previous;
    }
  }
  return error.__cachedTrace;
}
function prepareStackTrace( error, structuredStackTrace ) {
  // If error already have a cached trace inside, just return that
  // happens on true errors most
  if ( error.__cachedTrace ) { return error.__cachedTrace; }

  const stackTrace = utils.createStackTrace( error, structuredStackTrace );
  error.__cachedTrace = utils.removeInternalFrames( filename, stackTrace );

  if ( !error.__previous ) {
    let previousTraceError = currentTraceError;
    while ( previousTraceError ) {
      const previousTrace = utils.removeInternalFrames( filename, previousTraceError.stack );
      // append old stack trace to the "cachedTrace"
      error.__cachedTrace += `${utils.separator}${utils.breakLn}${previousTraceError.__location}\n`;
      error.__cachedTrace += previousTrace.substring( previousTrace.indexOf( '\n' ) + 1 );

      previousTraceError = previousTraceError.__previous;
    }
  }
  return error.__cachedTrace;
}
function prepareStackTrace ( error , structuredStackTrace ) { // If error already have a cached trace inside, just return that // happens on true errors most if ( error . __cachedTrace ) { return error . __cachedTrace ; } const stackTrace = utils . createStackTrace ( error , structuredStackTrace ) ; error . __cachedTrace = utils . removeInternalFrames ( filename , stackTrace ) ; if ( ! error . __previous ) { let previousTraceError = currentTraceError ; while ( previousTraceError ) { const previousTrace = utils . removeInternalFrames ( filename , previousTraceError . stack ) ; // append old stack trace to the "cachedTrace" error . __cachedTrace += ` ${ utils . separator } ${ utils . breakLn } ${ previousTraceError . __location } \n ` ; error . __cachedTrace += previousTrace . substring ( previousTrace . indexOf ( '\n' ) + 1 ) ; previousTraceError = previousTraceError . __previous ; } } return error . __cachedTrace ; }
Custom prepareStackTrace preparation, to be used on place o of the native

@param {Error} error Error being used as start point for the stack
@param {Callsite[]} structuredStackTrace Array of Callsites, which are previous stests from a stack trace, in a native object format
Custom prepareStackTrace preparation to be used on place o of the native