MCPcopy Index your code
hub / github.com/nodejs/node / getSourceMapErrorSource

Function getSourceMapErrorSource

lib/internal/source_map/prepare_stack_trace.js:185–197  ·  view source on GitHub ↗

* Retrieve exact line in the original source code from the source map's `sources` list or disk. * @param {string} fileName - actual file name * @param {number} lineNumber - actual line number * @param {number} columnNumber - actual column number * @returns {string | undefined} - the source conte

(fileName, lineNumber, columnNumber)

Source from the content-addressed store, hash-verified

183 * @returns {string | undefined} - the source content or undefined if file not found
184 */
185function getSourceMapErrorSource(fileName, lineNumber, columnNumber) {
186 const sm = findSourceMap(fileName);
187 if (sm === undefined) {
188 return;
189 }
190 const {
191 originalLine,
192 originalColumn,
193 originalSource,
194 } = sm.findEntry(lineNumber - 1, columnNumber);
195 const errorSource = getErrorSource(sm, originalSource, originalLine, originalColumn);
196 return errorSource;
197}
198
199setGetSourceMapErrorSource(getSourceMapErrorSource);
200

Callers

nothing calls this directly

Calls 3

findSourceMapFunction · 0.85
getErrorSourceFunction · 0.85
findEntryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…