* Get the source expression of an error. If source map is enabled, resolve the source location * based on the source map. * * The `error.stack` must not have been accessed, or the source location may be incorrect. The * resolution is based on the structured error stack data. * @param {Error|obj
(error)
| 151 | * @returns {string|undefined} |
| 152 | */ |
| 153 | function getErrorSourceExpression(error) { |
| 154 | const loc = getErrorSourceLocation(error); |
| 155 | if (loc === undefined) { |
| 156 | return; |
| 157 | } |
| 158 | const { sourceLine, startColumn } = loc; |
| 159 | return getFirstExpression(sourceLine, startColumn); |
| 160 | } |
| 161 | |
| 162 | module.exports = { |
| 163 | getErrorSourceLocation, |
no test coverage detected
searching dependent graphs…