Skip to content

Commit 6fbaa7a

Browse files
author
Max Schaefer
committed
JavaScript: Make File not extend Locatable anymore.
Files have strange `:0:0:0:0` locations for... reasons. This makes the predicates inherited from `Locatable` meaningless. A particularly bad case is `getNumLines()`, which will always return one. The right predicate to use is, of course, `getNumberOfLines()`, which is defined in `File` itself.
1 parent 46b6e6d commit 6fbaa7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/Files.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class Folder extends Container, @folder {
198198
}
199199

200200
/** A file. */
201-
class File extends Container, @file, Locatable {
202-
override Location getLocation() { hasLocation(this, result) }
201+
class File extends Container, @file {
202+
Location getLocation() { hasLocation(this, result) }
203203

204204
override string getAbsolutePath() { files(this, result, _, _, _) }
205205

0 commit comments

Comments
 (0)