mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 10:00:13 -06:00
Move option under 'strict'.
This commit is contained in:
parent
cccf22a3cf
commit
7c01840b7d
@ -354,6 +354,7 @@ namespace ts {
|
||||
const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
||||
const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
||||
const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
||||
const useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
||||
const keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
||||
const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : ObjectFlags.FreshLiteral;
|
||||
|
||||
@ -8603,7 +8604,7 @@ namespace ts {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
||||
const decl = declaration as VariableDeclaration;
|
||||
if (!decl.type) return compilerOptions.useUnknownInCatchVariables ? unknownType : anyType;
|
||||
if (!decl.type) return useUnknownInCatchVariables ? unknownType : anyType;
|
||||
const type = getTypeOfNode(decl.type);
|
||||
// an errorType will make `checkTryStatement` issue an error
|
||||
return isTypeAny(type) || type === unknownType ? type : errorType;
|
||||
|
||||
@ -6002,6 +6002,7 @@ namespace ts {
|
||||
| "strictBindCallApply"
|
||||
| "strictPropertyInitialization"
|
||||
| "alwaysStrict"
|
||||
| "useUnknownInCatchVariables"
|
||||
;
|
||||
|
||||
export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user