Rename `isClassFieldAndNotAutoAccessor` to `isClassInstanceProperty` (#55921)
This commit is contained in:
Родитель
a48cebf65d
Коммит
df5093e7bd
|
@ -480,7 +480,7 @@ import {
|
|||
isClassDeclaration,
|
||||
isClassElement,
|
||||
isClassExpression,
|
||||
isClassFieldAndNotAutoAccessor,
|
||||
isClassInstanceProperty,
|
||||
isClassLike,
|
||||
isClassStaticBlockDeclaration,
|
||||
isCommaSequence,
|
||||
|
@ -31893,7 +31893,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
|||
}
|
||||
// A class field cannot be accessed via super.* from a derived class.
|
||||
// This is true for both [[Set]] (old) and [[Define]] (ES spec) semantics.
|
||||
if (!(flags & ModifierFlags.Static) && prop.declarations?.some(isClassFieldAndNotAutoAccessor)) {
|
||||
if (!(flags & ModifierFlags.Static) && prop.declarations?.some(isClassInstanceProperty)) {
|
||||
if (errorNode) {
|
||||
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
||||
}
|
||||
|
|
|
@ -1709,7 +1709,7 @@ export function isAutoAccessorPropertyDeclaration(node: Node): node is AutoAcces
|
|||
}
|
||||
|
||||
/** @internal */
|
||||
export function isClassFieldAndNotAutoAccessor(node: Declaration): boolean {
|
||||
export function isClassInstanceProperty(node: Declaration): boolean {
|
||||
if (isInJSFile(node) && isExpandoPropertyDeclaration(node)) {
|
||||
return (!isBindableStaticAccessExpression(node) || !isPrototypeAccess(node.expression)) && !isBindableStaticNameExpression(node, /*excludeThisKeyword*/ true);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче