* @param {CallSite} callSite // The call site object to reconstruct from source map * @returns {CallSite | undefined} // The reconstructed call site object
(callSite)
| 508 | * @returns {CallSite | undefined} // The reconstructed call site object |
| 509 | */ |
| 510 | function reconstructCallSite(callSite) { |
| 511 | const { scriptName, lineNumber, columnNumber } = callSite; |
| 512 | const sourceMap = lazySourceMap().findSourceMap(scriptName); |
| 513 | if (!sourceMap) return; |
| 514 | const entry = sourceMap.findEntry(lineNumber - 1, columnNumber - 1); |
| 515 | if (!entry?.originalSource) return; |
| 516 | return { |
| 517 | __proto__: null, |
| 518 | // If the name is not found, it is an empty string to match the behavior of `util.getCallSite()` |
| 519 | functionName: entry.name ?? '', |
| 520 | scriptName: entry.originalSource, |
| 521 | lineNumber: entry.originalLine + 1, |
| 522 | column: entry.originalColumn + 1, |
| 523 | columnNumber: entry.originalColumn + 1, |
| 524 | }; |
| 525 | } |
| 526 | |
| 527 | /** |
| 528 | * |
no test coverage detected
searching dependent graphs…