Fix class name reference in class expr (#44877)

This commit is contained in:
Ron Buckton
2021-07-02 18:37:23 -07:00
committed by GitHub
parent 62f9155a9d
commit 8b496ed34c
5 changed files with 172 additions and 1 deletions

View File

@@ -24354,7 +24354,7 @@ namespace ts {
let container = getThisContainer(node, /*includeArrowFunctions*/ false);
while (container.kind !== SyntaxKind.SourceFile) {
if (container.parent === declaration) {
if (container.kind === SyntaxKind.PropertyDeclaration && isStatic(container)) {
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
getNodeLinks(declaration).flags |= NodeCheckFlags.ClassWithConstructorReference;
getNodeLinks(node).flags |= NodeCheckFlags.ConstructorReferenceInClass;
}