JS: Add ImportSpecifier.getImportDeclaration()

This commit is contained in:
Asger F
2025-03-11 11:50:06 +01:00
parent 5064cd5d94
commit 9fc0b8c9cc

View File

@@ -180,6 +180,9 @@ deprecated private class LiteralImportPath extends PathExpr, ConstantString {
* ```
*/
class ImportSpecifier extends Expr, @import_specifier {
/** Gets the import declaration in which this specifier appears. */
ImportDeclaration getImportDeclaration() { result.getASpecifier() = this }
/** Gets the imported symbol; undefined for default and namespace import specifiers. */
Identifier getImported() { result = this.getChildExpr(0) }