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

Function cloneCallSite

packages/vite/src/module-runner/sourcemap/interceptor.ts:332–345  ·  view source on GitHub ↗
(frame: CallSite)

Source from the content-addressed store, hash-verified

330}
331
332function cloneCallSite(frame: CallSite) {
333 const object = {} as CallSite
334 Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => {
335 const key = name as keyof CallSite
336 // @ts-expect-error difficult to type
337 object[key] = /^(?:is|get)/.test(name)
338 ? function () {
339 return frame[key].call(frame)
340 }
341 : frame[key]
342 })
343 object.toString = CallSiteToString
344 return object
345}
346
347function wrapCallSite(frame: CallSite, state: State) {
348 // provides interface backward compatibility

Callers 1

wrapCallSiteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected