add deprecated aliases getId() forwarding to getIdentifier()

This commit is contained in:
Erik Krogh Kristensen
2020-08-10 09:09:29 +02:00
parent f1dc36244c
commit 410b696562
2 changed files with 21 additions and 0 deletions

View File

@@ -77,6 +77,13 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
result = getDocumentation().getATagByTitle("this").getType()
}
/**
* DEPRECATED: Use `getIdentifier()` instead.
*
* Gets the identifier specifying the name of this function, if any.
*/
VarDecl getId() { result = getIdentifier() }
/** Gets the identifier specifying the name of this function, if any. */
VarDecl getIdentifier() { result = getChildExpr(-1) }

View File

@@ -7,6 +7,13 @@ import javascript
* considered to be namespace definitions.
*/
class NamespaceDefinition extends Stmt, @namespacedefinition, AST::ValueNode {
/**
* DEPRECATED: Use `getIdentifier()` instead.
*
* Gets the identifier naming the namespace.
*/
Identifier getId() { result = getIdentifier() }
/**
* Gets the identifier naming the namespace.
*/
@@ -174,6 +181,13 @@ class GlobalAugmentationDeclaration extends Stmt, StmtContainer, @globalaugmenta
/** A TypeScript "import-equals" declaration. */
class ImportEqualsDeclaration extends Stmt, @importequalsdeclaration {
/**
* DEPRECATED: Use `getIdentifier()` instead.
*
* Gets the name under which the imported entity is imported.
*/
Identifier getId() { result = getIdentifier() }
/** Gets the name under which the imported entity is imported. */
Identifier getIdentifier() { result = getChildExpr(0) }