Skip to content

Commit 34a9c2f

Browse files
committed
JS: Add ImportSpecifier.getImportDeclaration()
1 parent 123c92d commit 34a9c2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ private class LiteralImportPath extends PathExpr, ConstantString {
174174
* ```
175175
*/
176176
class ImportSpecifier extends Expr, @import_specifier {
177+
/** Gets the import declaration in which this specifier appears. */
178+
ImportDeclaration getImportDeclaration() { result.getASpecifier() = this }
179+
177180
/** Gets the imported symbol; undefined for default and namespace import specifiers. */
178181
Identifier getImported() { result = this.getChildExpr(0) }
179182

0 commit comments

Comments
 (0)