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

Function addMapping

test/fixtures/snapshot/typescript.js:90079–90107  ·  view source on GitHub ↗
(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex)

Source from the content-addressed store, hash-verified

90077 || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter);
90078 }
90079 function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) {
90080 ts.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack");
90081 ts.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative");
90082 ts.Debug.assert(sourceIndex === undefined || sourceIndex >= 0, "sourceIndex cannot be negative");
90083 ts.Debug.assert(sourceLine === undefined || sourceLine >= 0, "sourceLine cannot be negative");
90084 ts.Debug.assert(sourceCharacter === undefined || sourceCharacter >= 0, "sourceCharacter cannot be negative");
90085 enter();
90086 // If this location wasn't recorded or the location in source is going backwards, record the mapping
90087 if (isNewGeneratedPosition(generatedLine, generatedCharacter) ||
90088 isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) {
90089 commitPendingMapping();
90090 pendingGeneratedLine = generatedLine;
90091 pendingGeneratedCharacter = generatedCharacter;
90092 hasPendingSource = false;
90093 hasPendingName = false;
90094 hasPending = true;
90095 }
90096 if (sourceIndex !== undefined && sourceLine !== undefined && sourceCharacter !== undefined) {
90097 pendingSourceIndex = sourceIndex;
90098 pendingSourceLine = sourceLine;
90099 pendingSourceCharacter = sourceCharacter;
90100 hasPendingSource = true;
90101 if (nameIndex !== undefined) {
90102 pendingNameIndex = nameIndex;
90103 hasPendingName = true;
90104 }
90105 }
90106 exit();
90107 }
90108 function appendSourceMap(generatedLine, generatedCharacter, map, sourceMapPath, start, end) {
90109 ts.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack");
90110 ts.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative");

Callers 1

appendSourceMapFunction · 0.85

Calls 6

isNewGeneratedPositionFunction · 0.85
commitPendingMappingFunction · 0.85
assertMethod · 0.80
enterFunction · 0.70
exitFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…