Skip to content

Commit 0758413

Browse files
committed
revert change to import
1 parent 742abf8 commit 0758413

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

javascript/ql/src/semmle/javascript/NodeJS.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ class Require extends CallExpr, Import {
175175

176176
override Module resolveImportedPath() {
177177
moduleInFile(result, load(min(int prio | moduleInFile(_, load(prio)))))
178-
or
179-
not exists(Module mod | moduleInFile(mod, load(_))) and
180-
result = Import.super.resolveImportedPath()
181178
}
182179

183180
/**

javascript/ql/src/semmle/javascript/Paths.qll

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ abstract class PathString extends string {
145145
n = 0 and result.getContainer() = root and root = getARootFolder()
146146
or
147147
exists(Path base | base = resolveUpTo(n - 1, root) |
148-
exists(string next |
149-
next = getComponent(n - 1)
150-
or
151-
next = getOriginalTypeScriptFolder(getComponent(n - 1), base.getContainer())
152-
|
148+
exists(string next | next = getComponent(n - 1) |
153149
// handle empty components and the special "." folder
154150
(next = "" or next = ".") and
155151
result = base
@@ -178,42 +174,6 @@ abstract class PathString extends string {
178174
Path resolve(Folder root) { result = resolveUpTo(getNumComponent(), root) }
179175
}
180176

181-
/**
182-
* Gets the first folder from `path`.
183-
*/
184-
bindingset[path]
185-
private string getRootFolderFromPath(string path) {
186-
not exists(path.indexOf("/")) and result = path
187-
or
188-
result = path.substring(0, path.indexOf("/", 0, 0))
189-
}
190-
191-
/**
192-
* Gets a folder of TypeScript files that is compiled into JavaScript files in `outdir` relative to a `parent`.
193-
*/
194-
private string getOriginalTypeScriptFolder(string outdir, Folder parent) {
195-
exists(JSONObject tsconfig |
196-
tsconfig.getFile().getBaseName() = "tsconfig.json" and
197-
tsconfig.isTopLevel() and
198-
tsconfig.getFile().getParentContainer() = parent
199-
|
200-
outdir =
201-
tsconfig
202-
.getPropValue("compilerOptions")
203-
.(JSONObject)
204-
.getPropValue("outDir")
205-
.(JSONString)
206-
.getValue() and
207-
result =
208-
getRootFolderFromPath(tsconfig
209-
.getPropValue("include")
210-
.(JSONArray)
211-
.getElementValue(_)
212-
.(JSONString)
213-
.getValue())
214-
)
215-
}
216-
217177
/**
218178
* An expression whose value represents a (relative or absolute) file system path.
219179
*

0 commit comments

Comments
 (0)