From 3fe05c8c810cdbfd1b850d334355625c40389adb Mon Sep 17 00:00:00 2001 From: Chakib Ljazouli Date: Tue, 16 Feb 2021 19:07:44 -0500 Subject: [PATCH] fix(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier (#38726) * Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQualifiedNameInPlaceOfIdentifier * Change deleting AllowQualifedNameInPlaceOfIdentifier to deprecating it instead. * Fix failing tests * Replace old value --- src/compiler/checker.ts | 2 +- src/compiler/types.ts | 6 ++++-- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e0ea6bac95f..85121e6c7c5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5757,7 +5757,7 @@ namespace ts { if (expectsIdentifier && chain.length !== 1 && !context.encounteredError - && !(context.flags & NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { + && !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier)) { context.encounteredError = true; } return createEntityNameFromSymbolChain(chain, chain.length - 1); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3585ff50a8f..9f304289622 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4289,7 +4289,9 @@ namespace ts { // Error handling AllowThisInObjectLiteral = 1 << 15, - AllowQualifedNameInPlaceOfIdentifier = 1 << 16, + AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, + /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ + AllowQualifedNameInPlaceOfIdentifier = AllowQualifiedNameInPlaceOfIdentifier, AllowAnonymousIdentifier = 1 << 17, AllowEmptyUnionOrIntersection = 1 << 18, AllowEmptyTuple = 1 << 19, @@ -4300,7 +4302,7 @@ namespace ts { AllowNodeModulesRelativePaths = 1 << 26, /* @internal */ DoNotIncludeSymbolChain = 1 << 27, // Skip looking up and printing an accessible symbol chain - IgnoreErrors = AllowThisInObjectLiteral | AllowQualifedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, + IgnoreErrors = AllowThisInObjectLiteral | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, // State InObjectTypeLiteral = 1 << 22, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1850919780d..d2e7603a3c9 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2261,6 +2261,8 @@ declare namespace ts { NoTypeReduction = 536870912, NoUndefinedOptionalParameterType = 1073741824, AllowThisInObjectLiteral = 32768, + AllowQualifiedNameInPlaceOfIdentifier = 65536, + /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ AllowQualifedNameInPlaceOfIdentifier = 65536, AllowAnonymousIdentifier = 131072, AllowEmptyUnionOrIntersection = 262144, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 1fb8c099d50..87bb3c3e61e 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2261,6 +2261,8 @@ declare namespace ts { NoTypeReduction = 536870912, NoUndefinedOptionalParameterType = 1073741824, AllowThisInObjectLiteral = 32768, + AllowQualifiedNameInPlaceOfIdentifier = 65536, + /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ AllowQualifedNameInPlaceOfIdentifier = 65536, AllowAnonymousIdentifier = 131072, AllowEmptyUnionOrIntersection = 262144,