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

Function getFlowTypeInStaticBlocks

test/fixtures/snapshot/typescript.js:56113–56133  ·  view source on GitHub ↗
(symbol, staticBlocks)

Source from the content-addressed store, hash-verified

56111 return getFlowTypeOfReference(reference, autoType, undefinedType);
56112 }
56113 function getFlowTypeInStaticBlocks(symbol, staticBlocks) {
56114 var accessName = ts.startsWith(symbol.escapedName, "__#")
56115 ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1])
56116 : ts.unescapeLeadingUnderscores(symbol.escapedName);
56117 for (var _i = 0, staticBlocks_1 = staticBlocks; _i < staticBlocks_1.length; _i++) {
56118 var staticBlock = staticBlocks_1[_i];
56119 var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName);
56120 ts.setParent(reference.expression, reference);
56121 ts.setParent(reference, staticBlock);
56122 reference.flowNode = staticBlock.returnFlowNode;
56123 var flowType = getFlowTypeOfProperty(reference, symbol);
56124 if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
56125 error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
56126 }
56127 // We don't infer a type if assignments are only null or undefined.
56128 if (everyType(flowType, isNullableType)) {
56129 continue;
56130 }
56131 return convertAutoToAny(flowType);
56132 }
56133 }
56134 function getFlowTypeInConstructor(symbol, constructor) {
56135 var accessName = ts.startsWith(symbol.escapedName, "__#")
56136 ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1])

Callers 1

Calls 7

getFlowTypeOfPropertyFunction · 0.85
symbolToStringFunction · 0.85
typeToStringFunction · 0.85
everyTypeFunction · 0.85
convertAutoToAnyFunction · 0.85
errorFunction · 0.70
splitMethod · 0.45

Tested by

no test coverage detected