Set parent pointers on manufactured reference for property initialization check (#27246)

This commit is contained in:
Wesley Wigham
2018-09-20 16:54:01 -07:00
committed by GitHub
parent 5f563c99f6
commit b56854a532
5 changed files with 55 additions and 0 deletions

View File

@@ -26185,6 +26185,8 @@ namespace ts {
function isPropertyInitializedInConstructor(propName: Identifier, propType: Type, constructor: ConstructorDeclaration) {
const reference = createPropertyAccess(createThis(), propName);
reference.expression.parent = reference;
reference.parent = constructor;
reference.flowNode = constructor.returnFlowNode;
const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
return !(getFalsyFlags(flowType) & TypeFlags.Undefined);