Skip to content

Commit 9fc0b8c

Browse files
committed
JS: Add ImportSpecifier.getImportDeclaration()
1 parent 5064cd5 commit 9fc0b8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

javascript/ql/lib/semmle/javascript/ES2015Modules.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ deprecated private class LiteralImportPath extends PathExpr, ConstantString {
180180
* ```
181181
*/
182182
class ImportSpecifier extends Expr, @import_specifier {
183+
/** Gets the import declaration in which this specifier appears. */
184+
ImportDeclaration getImportDeclaration() { result.getASpecifier() = this }
185+
183186
/** Gets the imported symbol; undefined for default and namespace import specifiers. */
184187
Identifier getImported() { result = this.getChildExpr(0) }
185188

0 commit comments

Comments
 (0)