@@ -9013,7 +9013,7 @@ namespace ts {
9013
9013
9014
9014
function getTypeOfSetAccessor(symbol: Symbol): Type | undefined {
9015
9015
const links = getSymbolLinks(symbol);
9016
- return links.writeType || (links.writeType = getTypeOfAccessorsWorker(symbol, /*isWrite */ true));
9016
+ return links.writeType || (links.writeType = getTypeOfAccessorsWorker(symbol, /*writing */ true));
9017
9017
}
9018
9018
9019
9019
function getTypeOfAccessorsWorker(symbol: Symbol, writing = false): Type | undefined {
@@ -9033,12 +9033,12 @@ namespace ts {
9033
9033
return type;
9034
9034
}
9035
9035
9036
- function resolveTypeOfAccessors(symbol: Symbol, isWrite = false) {
9036
+ function resolveTypeOfAccessors(symbol: Symbol, writing = false) {
9037
9037
const getter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.GetAccessor);
9038
9038
const setter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.SetAccessor);
9039
9039
9040
9040
// For write operations, prioritize type annotations on the setter
9041
- if (isWrite ) {
9041
+ if (writing ) {
9042
9042
const setterParameterType = getAnnotatedAccessorType(setter);
9043
9043
if (setterParameterType) {
9044
9044
const flags = getCheckFlags(symbol);
@@ -26618,9 +26618,9 @@ namespace ts {
26618
26618
*/
26619
26619
function checkPropertyAccessibility(
26620
26620
node: PropertyAccessExpression | QualifiedName | PropertyAccessExpression | VariableDeclaration | ParameterDeclaration | ImportTypeNode | PropertyAssignment | ShorthandPropertyAssignment | BindingElement,
26621
- isSuper: boolean, isWrite : boolean, type: Type, prop: Symbol, reportError = true): boolean {
26621
+ isSuper: boolean, writing : boolean, type: Type, prop: Symbol, reportError = true): boolean {
26622
26622
26623
- const flags = getDeclarationModifierFlagsFromSymbol(prop, isWrite );
26623
+ const flags = getDeclarationModifierFlagsFromSymbol(prop, writing );
26624
26624
const errorNode = node.kind === SyntaxKind.QualifiedName ? node.right :
26625
26625
node.kind === SyntaxKind.ImportType ? node :
26626
26626
node.kind === SyntaxKind.BindingElement && node.propertyName ? node.propertyName : node.name;
@@ -26995,14 +26995,14 @@ namespace ts {
26995
26995
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
26996
26996
markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
26997
26997
getNodeLinks(node).resolvedSymbol = prop;
26998
- const isWrite = isWriteAccess(node);
26999
- checkPropertyAccessibility(node, left.kind === SyntaxKind.SuperKeyword, isWrite , apparentType, prop);
26998
+ const writing = isWriteAccess(node);
26999
+ checkPropertyAccessibility(node, left.kind === SyntaxKind.SuperKeyword, writing , apparentType, prop);
27000
27000
if (isAssignmentToReadonlyEntity(node as Expression, prop, assignmentKind)) {
27001
27001
error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right));
27002
27002
return errorType;
27003
27003
}
27004
27004
27005
- propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : isWrite ? getSetAccessorTypeOfSymbol(prop) : getTypeOfSymbol(prop);
27005
+ propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getSetAccessorTypeOfSymbol(prop) : getTypeOfSymbol(prop);
27006
27006
}
27007
27007
27008
27008
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
@@ -27394,7 +27394,7 @@ namespace ts {
27394
27394
const declClass = getContainingClass(prop.valueDeclaration);
27395
27395
return !isOptionalChain(node) && !!findAncestor(node, parent => parent === declClass);
27396
27396
}
27397
- return checkPropertyAccessibility(node, isSuper, /*isWrite */ false, type, prop, /* reportError */ false);
27397
+ return checkPropertyAccessibility(node, isSuper, /*writing */ false, type, prop, /* reportError */ false);
27398
27398
}
27399
27399
// In js files properties of unions are allowed in completion
27400
27400
return isInJSFile(node) && (type.flags & TypeFlags.Union) !== 0 && (<UnionType>type).types.some(elementType => isValidPropertyAccessWithType(node, isSuper, propertyName, elementType));
@@ -31033,7 +31033,7 @@ namespace ts {
31033
31033
const prop = getPropertyOfType(objectLiteralType, text);
31034
31034
if (prop) {
31035
31035
markPropertyAsReferenced(prop, property, rightIsThis);
31036
- checkPropertyAccessibility(property, /*isSuper*/ false, /*isWrite */ true, objectLiteralType, prop);
31036
+ checkPropertyAccessibility(property, /*isSuper*/ false, /*writing */ true, objectLiteralType, prop);
31037
31037
}
31038
31038
}
31039
31039
const elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, AccessFlags.ExpressionPosition);
@@ -34996,7 +34996,7 @@ namespace ts {
34996
34996
const property = getPropertyOfType(parentType, nameText);
34997
34997
if (property) {
34998
34998
markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isSelfTypeAccess*/ false); // A destructuring is never a write-only reference.
34999
- checkPropertyAccessibility(node, !!parent.initializer && parent.initializer.kind === SyntaxKind.SuperKeyword, /*isWrite */ false, parentType, property);
34999
+ checkPropertyAccessibility(node, !!parent.initializer && parent.initializer.kind === SyntaxKind.SuperKeyword, /*writing */ false, parentType, property);
35000
35000
}
35001
35001
}
35002
35002
}
0 commit comments