MCPcopy
hub / github.com/vitejs/vite / prepareStackTrace

Function prepareStackTrace

packages/vite/src/module-runner/sourcemap/interceptor.ts:411–424  ·  view source on GitHub ↗
(error: Error, stack: CallSite[])

Source from the content-addressed store, hash-verified

409}
410
411function prepareStackTrace(error: Error, stack: CallSite[]) {
412 const name = error.name || 'Error'
413 const message = error.message || ''
414 const errorString = `${name}: ${message}`
415
416 const state = { nextPosition: null, curPosition: null }
417 const processedStack = []
418 for (let i = stack.length - 1; i >= 0; i--) {
419 processedStack.push(`\n at ${wrapCallSite(stack[i], state)}`)
420 state.nextPosition = state.curPosition
421 }
422 state.curPosition = state.nextPosition = null
423 return errorString + processedStack.reverse().join('')
424}

Callers

nothing calls this directly

Calls 1

wrapCallSiteFunction · 0.85

Tested by

no test coverage detected