mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Rename isClassFieldAndNotAutoAccessor to isClassInstanceProperty (#55921)
This commit is contained in:
parent
a48cebf65d
commit
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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user