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 Wesley Wigham
parent 9103191527
commit 93f6b73c8c
5 changed files with 55 additions and 0 deletions

View File

@@ -26176,6 +26176,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);