(sourceMap, callSite, callerCallSite)
| 120 | // Transpilers may have removed the original symbol name used in the stack |
| 121 | // trace, if possible restore it from the names field of the source map: |
| 122 | function getOriginalSymbolName(sourceMap, callSite, callerCallSite) { |
| 123 | // First check for a symbol name associated with the enclosing function: |
| 124 | const enclosingEntry = sourceMap.findEntry( |
| 125 | callSite.getEnclosingLineNumber() - 1, |
| 126 | callSite.getEnclosingColumnNumber() - 1, |
| 127 | ); |
| 128 | if (enclosingEntry.name) return enclosingEntry.name; |
| 129 | // Fallback to using the symbol name attached to the caller site: |
| 130 | const currentFileName = callSite.getFileName(); |
| 131 | if (callerCallSite && currentFileName === callerCallSite.getFileName()) { |
| 132 | const { name } = sourceMap.findEntry( |
| 133 | callerCallSite.getLineNumber() - 1, |
| 134 | callerCallSite.getColumnNumber() - 1, |
| 135 | ); |
| 136 | return name; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Return a snippet of code from where the exception was originally thrown |
no test coverage detected
searching dependent graphs…