From 85ec98730d1ea09327f70f8b52ad6c3385c306cf Mon Sep 17 00:00:00 2001 From: Chakib Ljazouli Date: Thu, 21 May 2020 22:21:26 -0400 Subject: [PATCH 1/4] Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQualifiedNameInPlaceOfIdentifier --- src/compiler/checker.ts | 2 +- src/compiler/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 32965372e83fc..5df216a5c0a49 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5366,7 +5366,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 0c45dca9529fc..aec9a205d5437 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3691,7 +3691,7 @@ namespace ts { // Error handling AllowThisInObjectLiteral = 1 << 15, - AllowQualifedNameInPlaceOfIdentifier = 1 << 16, + AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, AllowAnonymousIdentifier = 1 << 17, AllowEmptyUnionOrIntersection = 1 << 18, AllowEmptyTuple = 1 << 19, @@ -3702,7 +3702,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, From b40e2a140d30cbe7dd2f10a3c3c3aba43d441200 Mon Sep 17 00:00:00 2001 From: Chakib Ljazouli Date: Fri, 22 May 2020 04:00:16 -0400 Subject: [PATCH 2/4] Change deleting AllowQualifedNameInPlaceOfIdentifier to deprecating it instead. --- src/compiler/checker.ts | 3 ++- src/compiler/types.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5df216a5c0a49..74cb1f45b7f8d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5366,7 +5366,8 @@ namespace ts { if (expectsIdentifier && chain.length !== 1 && !context.encounteredError - && !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier)) { + && !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier) + && !(context.flags & NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { context.encounteredError = true; } return createEntityNameFromSymbolChain(chain, chain.length - 1); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index aec9a205d5437..32238fe7a9803 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3692,6 +3692,8 @@ namespace ts { // Error handling AllowThisInObjectLiteral = 1 << 15, AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, + /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ + AllowQualifedNameInPlaceOfIdentifier = 1 << 16, AllowAnonymousIdentifier = 1 << 17, AllowEmptyUnionOrIntersection = 1 << 18, AllowEmptyTuple = 1 << 19, @@ -3702,7 +3704,7 @@ namespace ts { AllowNodeModulesRelativePaths = 1 << 26, /* @internal */ DoNotIncludeSymbolChain = 1 << 27, // Skip looking up and printing an accessible symbol chain - IgnoreErrors = AllowThisInObjectLiteral | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, + IgnoreErrors = AllowThisInObjectLiteral | AllowQualifedNameInPlaceOfIdentifier | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, // State InObjectTypeLiteral = 1 << 22, From a767a37aa6e7fac2d74bcae311654b48dd89aa5a Mon Sep 17 00:00:00 2001 From: Chakib Ljazouli Date: Fri, 22 May 2020 04:44:16 -0400 Subject: [PATCH 3/4] Fix failing tests --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 70e563b7e1cf7..f1b61949df411 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2138,6 +2138,8 @@ declare namespace ts { UseSingleQuotesForStringLiteralType = 268435456, NoTypeReduction = 536870912, 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 b6397f88523d9..3ee581b4b17ea 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2138,6 +2138,8 @@ declare namespace ts { UseSingleQuotesForStringLiteralType = 268435456, NoTypeReduction = 536870912, AllowThisInObjectLiteral = 32768, + AllowQualifiedNameInPlaceOfIdentifier = 65536, + /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ AllowQualifedNameInPlaceOfIdentifier = 65536, AllowAnonymousIdentifier = 131072, AllowEmptyUnionOrIntersection = 262144, From 418c232130dab7a4c955f47ed012be70ddfec3aa Mon Sep 17 00:00:00 2001 From: Chakib Date: Fri, 4 Sep 2020 11:38:39 -0400 Subject: [PATCH 4/4] Replace old value --- src/compiler/checker.ts | 3 +-- src/compiler/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 74cb1f45b7f8d..5df216a5c0a49 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5366,8 +5366,7 @@ namespace ts { if (expectsIdentifier && chain.length !== 1 && !context.encounteredError - && !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier) - && !(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 32238fe7a9803..8f47c8cbc9e8d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3693,7 +3693,7 @@ namespace ts { AllowThisInObjectLiteral = 1 << 15, AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ - AllowQualifedNameInPlaceOfIdentifier = 1 << 16, + AllowQualifedNameInPlaceOfIdentifier = AllowQualifiedNameInPlaceOfIdentifier, AllowAnonymousIdentifier = 1 << 17, AllowEmptyUnionOrIntersection = 1 << 18, AllowEmptyTuple = 1 << 19, @@ -3704,7 +3704,7 @@ namespace ts { AllowNodeModulesRelativePaths = 1 << 26, /* @internal */ DoNotIncludeSymbolChain = 1 << 27, // Skip looking up and printing an accessible symbol chain - IgnoreErrors = AllowThisInObjectLiteral | AllowQualifedNameInPlaceOfIdentifier | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, + IgnoreErrors = AllowThisInObjectLiteral | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, // State InObjectTypeLiteral = 1 << 22,