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

Function trackExistingEntityName

test/fixtures/snapshot/typescript.js:53966–53991  ·  view source on GitHub ↗
(node, context, includePrivateSymbol)

Source from the content-addressed store, hash-verified

53964 return typeToTypeNodeHelper(type, context);
53965 }
53966 function trackExistingEntityName(node, context, includePrivateSymbol) {
53967 var _a, _b;
53968 var introducesError = false;
53969 var leftmost = ts.getFirstIdentifier(node);
53970 if (ts.isInJSFile(node) && (ts.isExportsIdentifier(leftmost) || ts.isModuleExportsAccessExpression(leftmost.parent) || (ts.isQualifiedName(leftmost.parent) && ts.isModuleIdentifier(leftmost.parent.left) && ts.isExportsIdentifier(leftmost.parent.right)))) {
53971 introducesError = true;
53972 return { introducesError: introducesError, node: node };
53973 }
53974 var sym = resolveEntityName(leftmost, 67108863 /* SymbolFlags.All */, /*ignoreErrors*/ true, /*dontResolveALias*/ true);
53975 if (sym) {
53976 if (isSymbolAccessible(sym, context.enclosingDeclaration, 67108863 /* SymbolFlags.All */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility !== 0 /* SymbolAccessibility.Accessible */) {
53977 introducesError = true;
53978 }
53979 else {
53980 (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.trackSymbol) === null || _b === void 0 ? void 0 : _b.call(_a, sym, context.enclosingDeclaration, 67108863 /* SymbolFlags.All */);
53981 includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym);
53982 }
53983 if (ts.isIdentifier(node)) {
53984 var type = getDeclaredTypeOfSymbol(sym);
53985 var name = sym.flags & 262144 /* SymbolFlags.TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : ts.factory.cloneNode(node);
53986 name.symbol = sym; // for quickinfo, which uses identifier symbol information
53987 return { introducesError: introducesError, node: ts.setEmitFlags(ts.setOriginalNode(name, node), 16777216 /* EmitFlags.NoAsciiEscaping */) };
53988 }
53989 }
53990 return { introducesError: introducesError, node: node };
53991 }
53992 function serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled) {
53993 if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
53994 cancellationToken.throwIfCancellationRequested();

Callers 2

sanitizeJSDocImplementsFunction · 0.85

Calls 7

resolveEntityNameFunction · 0.85
isSymbolAccessibleFunction · 0.85
includePrivateSymbolFunction · 0.85
getDeclaredTypeOfSymbolFunction · 0.85
isTypeSymbolAccessibleFunction · 0.85
typeParameterToNameFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…