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

Function setSourceMapSource

test/fixtures/snapshot/typescript.js:115138–115158  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

115136 return tokenPos;
115137 }
115138 function setSourceMapSource(source) {
115139 if (sourceMapsDisabled) {
115140 return;
115141 }
115142 sourceMapSource = source;
115143 if (source === mostRecentlyAddedSourceMapSource) {
115144 // Fast path for when the new source map is the most recently added, in which case
115145 // we use its captured index without going through the source map generator.
115146 sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex;
115147 return;
115148 }
115149 if (isJsonSourceMapSource(source)) {
115150 return;
115151 }
115152 sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName);
115153 if (printerOptions.inlineSources) {
115154 sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text);
115155 }
115156 mostRecentlyAddedSourceMapSource = source;
115157 mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex;
115158 }
115159 function resetSourceMapSource(source, sourceIndex) {
115160 sourceMapSource = source;
115161 sourceMapSourceIndex = sourceIndex;

Callers 2

setSourceFileFunction · 0.85
emitSourcePosFunction · 0.85

Calls 1

isJsonSourceMapSourceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…