Skip to content

Commit 410b696

Browse files
committed
add deprecated aliases getId() forwarding to getIdentifier()
1 parent f1dc362 commit 410b696

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

javascript/ql/src/semmle/javascript/Functions.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
7777
result = getDocumentation().getATagByTitle("this").getType()
7878
}
7979

80+
/**
81+
* DEPRECATED: Use `getIdentifier()` instead.
82+
*
83+
* Gets the identifier specifying the name of this function, if any.
84+
*/
85+
VarDecl getId() { result = getIdentifier() }
86+
8087
/** Gets the identifier specifying the name of this function, if any. */
8188
VarDecl getIdentifier() { result = getChildExpr(-1) }
8289

javascript/ql/src/semmle/javascript/TypeScript.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import javascript
77
* considered to be namespace definitions.
88
*/
99
class NamespaceDefinition extends Stmt, @namespacedefinition, AST::ValueNode {
10+
/**
11+
* DEPRECATED: Use `getIdentifier()` instead.
12+
*
13+
* Gets the identifier naming the namespace.
14+
*/
15+
Identifier getId() { result = getIdentifier() }
16+
1017
/**
1118
* Gets the identifier naming the namespace.
1219
*/
@@ -174,6 +181,13 @@ class GlobalAugmentationDeclaration extends Stmt, StmtContainer, @globalaugmenta
174181

175182
/** A TypeScript "import-equals" declaration. */
176183
class ImportEqualsDeclaration extends Stmt, @importequalsdeclaration {
184+
/**
185+
* DEPRECATED: Use `getIdentifier()` instead.
186+
*
187+
* Gets the name under which the imported entity is imported.
188+
*/
189+
Identifier getId() { result = getIdentifier() }
190+
177191
/** Gets the name under which the imported entity is imported. */
178192
Identifier getIdentifier() { result = getChildExpr(0) }
179193

0 commit comments

Comments
 (0)