Skip to content

Commit f529457

Browse files
Move option under 'strict'.
1 parent cd08b62 commit f529457

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/compiler/checker.ts

+2-1
Original file line numberDiff line numberDiff 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

@@ -8929,7 +8930,7 @@ namespace ts {
89298930
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
89308931
const typeNode = getEffectiveTypeAnnotationNode(declaration);
89318932
if (typeNode === undefined) {
8932-
return compilerOptions.useUnknownInCatchVariables ? unknownType : anyType;
8933+
return useUnknownInCatchVariables ? unknownType : anyType;
89338934
}
89348935
const type = getTypeOfNode(typeNode);
89358936
// an errorType will make `checkTryStatement` issue an error

src/compiler/utilities.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6067,6 +6067,7 @@ namespace ts {
60676067
| "strictBindCallApply"
60686068
| "strictPropertyInitialization"
60696069
| "alwaysStrict"
6070+
| "useUnknownInCatchVariables"
60706071
;
60716072

60726073
export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean {

0 commit comments

Comments
 (0)