Skip to content

Remove deprecated escapeidentifier and unescapeidentifier functions #25333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,6 @@ namespace ts {
return (identifier.length >= 2 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier) as __String;
}

/**
* @deprecated Use `id.escapedText` to get the escaped text of an Identifier.
* @param identifier The identifier to escape
*/
export function escapeIdentifier(identifier: string): string {
return identifier;
}

// Make an identifier from an external module name by extracting the string after the last "/" and replacing
// all non-alphanumeric characters with underscores
export function makeIdentifierFromModuleName(moduleName: string): string {
Expand Down Expand Up @@ -4787,16 +4779,6 @@ namespace ts {
return unescapeLeadingUnderscores(symbol.escapedName);
}

/**
* Remove extra underscore from escaped identifier text content.
* @deprecated Use `id.text` for the unescaped text.
* @param identifier The escaped identifier text.
* @returns The unescaped identifier text.
*/
export function unescapeIdentifier(id: string): string {
return id;
}

/**
* A JSDocTypedef tag has an _optional_ name field - if a name is not directly present, we should
* attempt to draw the name from the node the declaration is on (as that declaration is what its' symbol
Expand Down
12 changes: 0 additions & 12 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6129,11 +6129,6 @@ declare namespace ts {
function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile): string;
function getTextOfConstantValue(value: string | number): string;
function escapeLeadingUnderscores(identifier: string): __String;
/**
* @deprecated Use `id.escapedText` to get the escaped text of an Identifier.
* @param identifier The identifier to escape
*/
function escapeIdentifier(identifier: string): string;
function makeIdentifierFromModuleName(moduleName: string): string;
function isBlockOrCatchScoped(declaration: Declaration): boolean;
function isCatchClauseVariableDeclarationOrBindingElement(declaration: Declaration): boolean;
Expand Down Expand Up @@ -6731,13 +6726,6 @@ declare namespace ts {
function unescapeLeadingUnderscores(identifier: __String): string;
function idText(identifier: Identifier): string;
function symbolName(symbol: Symbol): string;
/**
* Remove extra underscore from escaped identifier text content.
* @deprecated Use `id.text` for the unescaped text.
* @param identifier The escaped identifier text.
* @returns The unescaped identifier text.
*/
function unescapeIdentifier(id: string): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
/** @internal */
function isNamedDeclaration(node: Node): node is NamedDeclaration & {
Expand Down
7 changes: 0 additions & 7 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3225,13 +3225,6 @@ declare namespace ts {
function unescapeLeadingUnderscores(identifier: __String): string;
function idText(identifier: Identifier): string;
function symbolName(symbol: Symbol): string;
/**
* Remove extra underscore from escaped identifier text content.
* @deprecated Use `id.text` for the unescaped text.
* @param identifier The escaped identifier text.
* @returns The unescaped identifier text.
*/
function unescapeIdentifier(id: string): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
/**
Expand Down