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

Function isPropertyInitializedInStaticBlocks

test/fixtures/snapshot/typescript.js:84594–84610  ·  view source on GitHub ↗
(propName, propType, staticBlocks, startPos, endPos)

Source from the content-addressed store, hash-verified

84592 !node.initializer;
84593 }
84594 function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
84595 for (var _i = 0, staticBlocks_2 = staticBlocks; _i < staticBlocks_2.length; _i++) {
84596 var staticBlock = staticBlocks_2[_i];
84597 // static block must be within the provided range as they are evaluated in document order (unlike constructors)
84598 if (staticBlock.pos >= startPos && staticBlock.pos <= endPos) {
84599 var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
84600 ts.setParent(reference.expression, reference);
84601 ts.setParent(reference, staticBlock);
84602 reference.flowNode = staticBlock.returnFlowNode;
84603 var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84604 if (!(getFalsyFlags(flowType) & 32768 /* TypeFlags.Undefined */)) {
84605 return true;
84606 }
84607 }
84608 }
84609 return false;
84610 }
84611 function isPropertyInitializedInConstructor(propName, propType, constructor) {
84612 var reference = ts.isComputedPropertyName(propName)
84613 ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)

Callers 1

Calls 3

getFlowTypeOfReferenceFunction · 0.85
getOptionalTypeFunction · 0.85
getFalsyFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…