@@ -27075,6 +27075,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
27075
27075
isFunctionLike(node) && !getImmediatelyInvokedFunctionExpression(node) ||
27076
27076
node.kind === SyntaxKind.ModuleBlock ||
27077
27077
node.kind === SyntaxKind.SourceFile ||
27078
+ node.kind === SyntaxKind.CatchClause ||
27078
27079
node.kind === SyntaxKind.PropertyDeclaration)!;
27079
27080
}
27080
27081
@@ -27447,6 +27448,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
27447
27448
const isParameter = getRootDeclaration(declaration).kind === SyntaxKind.Parameter;
27448
27449
const declarationContainer = getControlFlowContainer(declaration);
27449
27450
let flowContainer = getControlFlowContainer(node);
27451
+ const isCatch = flowContainer.kind === SyntaxKind.CatchClause;
27450
27452
const isOuterVariable = flowContainer !== declarationContainer;
27451
27453
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
27452
27454
const isModuleExports = symbol.flags & SymbolFlags.ModuleExports;
@@ -27461,7 +27463,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
27461
27463
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
27462
27464
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
27463
27465
// declaration container are the same).
27464
- const assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
27466
+ const assumeInitialized = isParameter || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
27465
27467
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (TypeFlags.AnyOrUnknown | TypeFlags.Void)) !== 0 ||
27466
27468
isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === SyntaxKind.ExportSpecifier) ||
27467
27469
node.parent.kind === SyntaxKind.NonNullExpression ||
0 commit comments