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

Function registerForUnusedIdentifiersCheck

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

Source from the content-addressed store, hash-verified

81931 }
81932 }
81933 function registerForUnusedIdentifiersCheck(node) {
81934 addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics);
81935 function registerForUnusedIdentifiersCheckDiagnostics() {
81936 // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`.
81937 var sourceFile = ts.getSourceFileOfNode(node);
81938 var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path);
81939 if (!potentiallyUnusedIdentifiers) {
81940 potentiallyUnusedIdentifiers = [];
81941 allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers);
81942 }
81943 // TODO: GH#22580
81944 // Debug.assert(addToSeen(seenPotentiallyUnusedIdentifiers, getNodeId(node)), "Adding potentially-unused identifier twice");
81945 potentiallyUnusedIdentifiers.push(node);
81946 }
81947 }
81948 function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
81949 for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {
81950 var node = potentiallyUnusedIdentifiers_1[_i];

Callers 13

checkInferTypeFunction · 0.85
checkBlockFunction · 0.85
checkForStatementFunction · 0.85
checkForOfStatementFunction · 0.85
checkForInStatementFunction · 0.85
checkSwitchStatementFunction · 0.85
checkClassDeclarationFunction · 0.85
checkModuleDeclarationFunction · 0.85

Calls 1

addLazyDiagnosticFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…