From 92337d701edd0a796e877db67451f6a16c6a73dd Mon Sep 17 00:00:00 2001 From: Asger F Date: Mon, 7 Apr 2025 06:52:11 +0200 Subject: [PATCH] Keep old resolveImportPath for comparison --- javascript/ql/lib/semmle/javascript/Modules.qll | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/Modules.qll b/javascript/ql/lib/semmle/javascript/Modules.qll index 35c783796fa..614fa44f2fc 100644 --- a/javascript/ql/lib/semmle/javascript/Modules.qll +++ b/javascript/ql/lib/semmle/javascript/Modules.qll @@ -140,8 +140,14 @@ abstract class Import extends AstNode { * Gets the module the path of this import resolves to. */ Module resolveImportedPath() { + result.getFile() = this.getEnclosingModule().resolve(this.getImportedPath()) + } + + /** + * Gets the module the path of this import resolves to. + */ + Module resolveImportedPathNew() { result.getFile() = PathResolution::resolvePathExpr(this.getImportedPath()) - // result.getFile() = this.getEnclosingModule().resolve(this.getImportedPath()) } /** @@ -189,7 +195,7 @@ abstract class Import extends AstNode { then result = this.resolveExternsImport() else ( result = this.resolveAsProvidedModule() or - result = this.resolveImportedPath() or + result = this.resolveImportedPathNew() or result = this.resolveFromTypeRoot() or result = this.resolveFromTypeScriptSymbol() or result = resolveNeighbourPackage(this.getImportedPath().getValue())