Skip to content

Commit 656f356

Browse files
authored
Remove deprecated escapeidentifier and unescapeidentifier functions (microsoft#25333)
1 parent 38d6491 commit 656f356

3 files changed

Lines changed: 0 additions & 37 deletions

File tree

src/compiler/utilities.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,6 @@ namespace ts {
559559
return (identifier.length >= 2 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier) as __String;
560560
}
561561

562-
/**
563-
* @deprecated Use `id.escapedText` to get the escaped text of an Identifier.
564-
* @param identifier The identifier to escape
565-
*/
566-
export function escapeIdentifier(identifier: string): string {
567-
return identifier;
568-
}
569-
570562
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
571563
// all non-alphanumeric characters with underscores
572564
export function makeIdentifierFromModuleName(moduleName: string): string {
@@ -4792,16 +4784,6 @@ namespace ts {
47924784
return unescapeLeadingUnderscores(symbol.escapedName);
47934785
}
47944786

4795-
/**
4796-
* Remove extra underscore from escaped identifier text content.
4797-
* @deprecated Use `id.text` for the unescaped text.
4798-
* @param identifier The escaped identifier text.
4799-
* @returns The unescaped identifier text.
4800-
*/
4801-
export function unescapeIdentifier(id: string): string {
4802-
return id;
4803-
}
4804-
48054787
/**
48064788
* A JSDocTypedef tag has an _optional_ name field - if a name is not directly present, we should
48074789
* attempt to draw the name from the node the declaration is on (as that declaration is what its' symbol

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6104,11 +6104,6 @@ declare namespace ts {
61046104
function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile): string;
61056105
function getTextOfConstantValue(value: string | number): string;
61066106
function escapeLeadingUnderscores(identifier: string): __String;
6107-
/**
6108-
* @deprecated Use `id.escapedText` to get the escaped text of an Identifier.
6109-
* @param identifier The identifier to escape
6110-
*/
6111-
function escapeIdentifier(identifier: string): string;
61126107
function makeIdentifierFromModuleName(moduleName: string): string;
61136108
function isBlockOrCatchScoped(declaration: Declaration): boolean;
61146109
function isCatchClauseVariableDeclarationOrBindingElement(declaration: Declaration): boolean;
@@ -6707,13 +6702,6 @@ declare namespace ts {
67076702
function unescapeLeadingUnderscores(identifier: __String): string;
67086703
function idText(identifier: Identifier): string;
67096704
function symbolName(symbol: Symbol): string;
6710-
/**
6711-
* Remove extra underscore from escaped identifier text content.
6712-
* @deprecated Use `id.text` for the unescaped text.
6713-
* @param identifier The escaped identifier text.
6714-
* @returns The unescaped identifier text.
6715-
*/
6716-
function unescapeIdentifier(id: string): string;
67176705
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
67186706
/** @internal */
67196707
function isNamedDeclaration(node: Node): node is NamedDeclaration & {

tests/baselines/reference/api/typescript.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,13 +3180,6 @@ declare namespace ts {
31803180
function unescapeLeadingUnderscores(identifier: __String): string;
31813181
function idText(identifier: Identifier): string;
31823182
function symbolName(symbol: Symbol): string;
3183-
/**
3184-
* Remove extra underscore from escaped identifier text content.
3185-
* @deprecated Use `id.text` for the unescaped text.
3186-
* @param identifier The escaped identifier text.
3187-
* @returns The unescaped identifier text.
3188-
*/
3189-
function unescapeIdentifier(id: string): string;
31903183
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
31913184
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
31923185
/**

0 commit comments

Comments
 (0)