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

Function getLabelReferencesInNode

test/fixtures/snapshot/typescript.js:138084–138092  ·  view source on GitHub ↗
(container, targetLabel)

Source from the content-addressed store, hash-verified

138082 return positions;
138083 }
138084 function getLabelReferencesInNode(container, targetLabel) {
138085 var sourceFile = container.getSourceFile();
138086 var labelName = targetLabel.text;
138087 var references = ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), function (node) {
138088 // Only pick labels that are either the target label, or have a target that is the target label
138089 return node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel) ? nodeEntry(node) : undefined;
138090 });
138091 return [{ definition: { type: 1 /* DefinitionKind.Label */, node: targetLabel }, references: references }];
138092 }
138093 function isValidReferencePosition(node, searchSymbolName) {
138094 // Compare the length so we filter out strict superstrings of the symbol we are looking for
138095 switch (node.kind) {

Callers 1

Calls 2

nodeEntryFunction · 0.85

Tested by

no test coverage detected