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

Function emitSourceMapsBeforeNode

test/fixtures/snapshot/typescript.js:115038–115060  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

115036 emitSourceMapsAfterNode(node);
115037 }
115038 function emitSourceMapsBeforeNode(node) {
115039 var emitFlags = ts.getEmitFlags(node);
115040 var sourceMapRange = ts.getSourceMapRange(node);
115041 // Emit leading sourcemap
115042 if (ts.isUnparsedNode(node)) {
115043 ts.Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers");
115044 var parsed = getParsedSourceMap(node.parent);
115045 if (parsed && sourceMapGenerator) {
115046 sourceMapGenerator.appendSourceMap(writer.getLine(), writer.getColumn(), parsed, node.parent.sourceMapPath, node.parent.getLineAndCharacterOfPosition(node.pos), node.parent.getLineAndCharacterOfPosition(node.end));
115047 }
115048 }
115049 else {
115050 var source = sourceMapRange.source || sourceMapSource;
115051 if (node.kind !== 349 /* SyntaxKind.NotEmittedStatement */
115052 && (emitFlags & 16 /* EmitFlags.NoLeadingSourceMap */) === 0
115053 && sourceMapRange.pos >= 0) {
115054 emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
115055 }
115056 if (emitFlags & 64 /* EmitFlags.NoNestedSourceMaps */) {
115057 sourceMapsDisabled = true;
115058 }
115059 }
115060 }
115061 function emitSourceMapsAfterNode(node) {
115062 var emitFlags = ts.getEmitFlags(node);
115063 var sourceMapRange = ts.getSourceMapRange(node);

Callers 2

onEnterFunction · 0.85

Calls 3

getParsedSourceMapFunction · 0.85
emitSourcePosFunction · 0.85
skipSourceTriviaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…