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
This commit is contained in:
Chakib Ljazouli
2021-02-16 19:07:44 -05:00
committed by GitHub
parent 3910d9ede2
commit 3fe05c8c81
4 changed files with 9 additions and 3 deletions

View File

@@ -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);

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,