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

Function getTypeOfFuncClassEnumModuleWorker

test/fixtures/snapshot/typescript.js:56772–56804  ·  view source on GitHub ↗
(symbol)

Source from the content-addressed store, hash-verified

56770 return links.type;
56771 }
56772 function getTypeOfFuncClassEnumModuleWorker(symbol) {
56773 var declaration = symbol.valueDeclaration;
56774 if (symbol.flags & 1536 /* SymbolFlags.Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) {
56775 return anyType;
56776 }
56777 else if (declaration && (declaration.kind === 221 /* SyntaxKind.BinaryExpression */ ||
56778 ts.isAccessExpression(declaration) &&
56779 declaration.parent.kind === 221 /* SyntaxKind.BinaryExpression */)) {
56780 return getWidenedTypeForAssignmentDeclaration(symbol);
56781 }
56782 else if (symbol.flags & 512 /* SymbolFlags.ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
56783 var resolvedModule = resolveExternalModuleSymbol(symbol);
56784 if (resolvedModule !== symbol) {
56785 if (!pushTypeResolution(symbol, 0 /* TypeSystemPropertyName.Type */)) {
56786 return errorType;
56787 }
56788 var exportEquals = getMergedSymbol(symbol.exports.get("export=" /* InternalSymbolName.ExportEquals */));
56789 var type_3 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
56790 if (!popTypeResolution()) {
56791 return reportCircularityError(symbol);
56792 }
56793 return type_3;
56794 }
56795 }
56796 var type = createObjectType(16 /* ObjectFlags.Anonymous */, symbol);
56797 if (symbol.flags & 32 /* SymbolFlags.Class */) {
56798 var baseTypeVariable = getBaseTypeVariableOfClass(symbol);
56799 return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type;
56800 }
56801 else {
56802 return strictNullChecks && symbol.flags & 16777216 /* SymbolFlags.Optional */ ? getOptionalType(type) : type;
56803 }
56804 }
56805 function getTypeOfEnumMember(symbol) {
56806 var links = getSymbolLinks(symbol);
56807 return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol));

Callers 1

Calls 11

pushTypeResolutionFunction · 0.85
getMergedSymbolFunction · 0.85
popTypeResolutionFunction · 0.85
reportCircularityErrorFunction · 0.85
createObjectTypeFunction · 0.85
getIntersectionTypeFunction · 0.85
getOptionalTypeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…