@@ -669,7 +669,7 @@ namespace ts {
669
669
}
670
670
// We create a return control flow graph for IIFEs and constructors. For constructors
671
671
// we use the return control flow graph in strict property initialization checks.
672
- currentReturnTarget = isIIFE || node . kind === SyntaxKind . Constructor || ( isInJSFile ( node ) && ( node . kind === SyntaxKind . FunctionDeclaration || node . kind === SyntaxKind . FunctionExpression ) ) ? createBranchLabel ( ) : undefined ;
672
+ currentReturnTarget = isIIFE || node . kind === SyntaxKind . Constructor || node . kind === SyntaxKind . ClassStaticBlockDeclaration || ( isInJSFile ( node ) && ( node . kind === SyntaxKind . FunctionDeclaration || node . kind === SyntaxKind . FunctionExpression ) ) ? createBranchLabel ( ) : undefined ;
673
673
currentExceptionTarget = undefined ;
674
674
currentBreakTarget = undefined ;
675
675
currentContinueTarget = undefined ;
@@ -678,10 +678,10 @@ namespace ts {
678
678
bindChildren ( node ) ;
679
679
// Reset all reachability check related flags on node (for incremental scenarios)
680
680
node . flags &= ~ NodeFlags . ReachabilityAndEmitFlags ;
681
- if ( ! ( currentFlow . flags & FlowFlags . Unreachable ) && containerFlags & ContainerFlags . IsFunctionLike && nodeIsPresent ( ( node as FunctionLikeDeclaration ) . body ) ) {
681
+ if ( ! ( currentFlow . flags & FlowFlags . Unreachable ) && containerFlags & ContainerFlags . IsFunctionLike && nodeIsPresent ( ( node as FunctionLikeDeclaration | ClassStaticBlockDeclaration ) . body ) ) {
682
682
node . flags |= NodeFlags . HasImplicitReturn ;
683
683
if ( hasExplicitReturn ) node . flags |= NodeFlags . HasExplicitReturn ;
684
- ( node as FunctionLikeDeclaration ) . endFlowNode = currentFlow ;
684
+ ( node as FunctionLikeDeclaration | ClassStaticBlockDeclaration ) . endFlowNode = currentFlow ;
685
685
}
686
686
if ( node . kind === SyntaxKind . SourceFile ) {
687
687
node . flags |= emitFlags ;
@@ -691,8 +691,8 @@ namespace ts {
691
691
if ( currentReturnTarget ) {
692
692
addAntecedent ( currentReturnTarget , currentFlow ) ;
693
693
currentFlow = finishFlowLabel ( currentReturnTarget ) ;
694
- if ( node . kind === SyntaxKind . Constructor || ( isInJSFile ( node ) && ( node . kind === SyntaxKind . FunctionDeclaration || node . kind === SyntaxKind . FunctionExpression ) ) ) {
695
- ( node as FunctionLikeDeclaration ) . returnFlowNode = currentFlow ;
694
+ if ( node . kind === SyntaxKind . Constructor || node . kind === SyntaxKind . ClassStaticBlockDeclaration || ( isInJSFile ( node ) && ( node . kind === SyntaxKind . FunctionDeclaration || node . kind === SyntaxKind . FunctionExpression ) ) ) {
695
+ ( node as FunctionLikeDeclaration | ClassStaticBlockDeclaration ) . returnFlowNode = currentFlow ;
696
696
}
697
697
}
698
698
if ( ! isIIFE ) {
@@ -1944,7 +1944,7 @@ namespace ts {
1944
1944
}
1945
1945
1946
1946
function declareClassMember ( node : Declaration , symbolFlags : SymbolFlags , symbolExcludes : SymbolFlags ) {
1947
- return hasSyntacticModifier ( node , ModifierFlags . Static )
1947
+ return isStatic ( node )
1948
1948
? declareSymbol ( container . symbol . exports ! , container . symbol , node , symbolFlags , symbolExcludes )
1949
1949
: declareSymbol ( container . symbol . members ! , container . symbol , node , symbolFlags , symbolExcludes ) ;
1950
1950
}
@@ -2950,7 +2950,7 @@ namespace ts {
2950
2950
// this.foo assignment in a JavaScript class
2951
2951
// Bind this property to the containing class
2952
2952
const containingClass = thisContainer . parent ;
2953
- const symbolTable = hasSyntacticModifier ( thisContainer , ModifierFlags . Static ) ? containingClass . symbol . exports ! : containingClass . symbol . members ! ;
2953
+ const symbolTable = isStatic ( thisContainer ) ? containingClass . symbol . exports ! : containingClass . symbol . members ! ;
2954
2954
if ( hasDynamicName ( node ) ) {
2955
2955
bindDynamicallyNamedThisPropertyAssignment ( node , containingClass . symbol , symbolTable ) ;
2956
2956
}
0 commit comments