Skip to content

Commit f289592

Browse files
committed
JS: Update to avoid deprecations after import resolution change
1 parent 7f7fc58 commit f289592

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

javascript/ql/lib/semmle/javascript/internal/NameResolution.qll

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ module NameResolution {
5555
// This ensures we can also use the PathExpr as a source when working with external (unresolved) modules.
5656
exists(Import imprt |
5757
node1 = imprt.getImportedModule() and
58-
node2 = imprt.getImportedPath()
58+
node2 = imprt.getImportedPathExpr()
5959
)
6060
or
6161
exists(ImportNamespaceSpecifier spec |
62-
node1 = spec.getImportDeclaration().getImportedPath() and
62+
node1 = spec.getImportDeclaration().getImportedPathExpr() and
6363
node2 = spec.getLocal()
6464
)
6565
or
@@ -79,7 +79,7 @@ module NameResolution {
7979
)
8080
or
8181
exists(ExternalModuleReference ref |
82-
node1 = ref.getImportedPath() and
82+
node1 = ref.getImportedPathExpr() and
8383
node2 = ref
8484
)
8585
or
@@ -195,7 +195,7 @@ module NameResolution {
195195
)
196196
or
197197
exists(ImportSpecifier spec |
198-
node1 = spec.getImportDeclaration().getImportedPath() and
198+
node1 = spec.getImportDeclaration().getImportedPathExpr() and
199199
name = spec.getImportedName() and
200200
node2 = spec.getLocal()
201201
)
@@ -411,12 +411,12 @@ module NameResolution {
411411
* Unlike `trackModule`, this is intended to track uses of external packages.
412412
*/
413413
predicate nodeRefersToModule(Node node, string mod, string qualifiedName) {
414-
exists(PathExpr path |
415-
path = any(Import imprt).getImportedPath() or
414+
exists(Expr path |
415+
path = any(Import imprt).getImportedPathExpr() or
416416
path = any(ReExportDeclaration e).getImportedPath()
417417
|
418418
node = path and
419-
mod = normalizeModuleName(path.getValue()) and
419+
mod = normalizeModuleName(path.getStringValue()) and
420420
isExternalModuleName(mod) and
421421
qualifiedName = ""
422422
)

0 commit comments

Comments
 (0)