File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ namespace ts {
354354 const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
355355 const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
356356 const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
357+ const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
357358 const keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
358359 const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : ObjectFlags.FreshLiteral;
359360
@@ -8603,7 +8604,7 @@ namespace ts {
86038604 const declaration = symbol.valueDeclaration;
86048605 if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
86058606 const decl = declaration as VariableDeclaration;
8606- if (!decl.type) return compilerOptions. useUnknownInCatchVariables ? unknownType : anyType;
8607+ if (!decl.type) return useUnknownInCatchVariables ? unknownType : anyType;
86078608 const type = getTypeOfNode(decl.type);
86088609 // an errorType will make `checkTryStatement` issue an error
86098610 return isTypeAny(type) || type === unknownType ? type : errorType;
Original file line number Diff line number Diff line change @@ -6002,6 +6002,7 @@ namespace ts {
60026002 | "strictBindCallApply"
60036003 | "strictPropertyInitialization"
60046004 | "alwaysStrict"
6005+ | "useUnknownInCatchVariables"
60056006 ;
60066007
60076008 export function getStrictOptionValue ( compilerOptions : CompilerOptions , flag : StrictOptionName ) : boolean {
You can’t perform that action at this time.
0 commit comments