File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ namespace ts {
354
354
const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
355
355
const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
356
356
const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
357
+ const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
357
358
const keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
358
359
const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : ObjectFlags.FreshLiteral;
359
360
@@ -8603,7 +8604,7 @@ namespace ts {
8603
8604
const declaration = symbol.valueDeclaration;
8604
8605
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
8605
8606
const decl = declaration as VariableDeclaration;
8606
- if (!decl.type) return compilerOptions. useUnknownInCatchVariables ? unknownType : anyType;
8607
+ if (!decl.type) return useUnknownInCatchVariables ? unknownType : anyType;
8607
8608
const type = getTypeOfNode(decl.type);
8608
8609
// an errorType will make `checkTryStatement` issue an error
8609
8610
return isTypeAny(type) || type === unknownType ? type : errorType;
Original file line number Diff line number Diff line change @@ -6002,6 +6002,7 @@ namespace ts {
6002
6002
| "strictBindCallApply"
6003
6003
| "strictPropertyInitialization"
6004
6004
| "alwaysStrict"
6005
+ | "useUnknownInCatchVariables"
6005
6006
;
6006
6007
6007
6008
export function getStrictOptionValue ( compilerOptions : CompilerOptions , flag : StrictOptionName ) : boolean {
You can’t perform that action at this time.
0 commit comments