We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Locatable.getLocation()
@file
1 parent 6fbaa7a commit 47cbf0bCopy full SHA for 47cbf0b
javascript/ql/src/semmle/javascript/Locations.qll
@@ -132,3 +132,15 @@ class Locatable extends @locatable {
132
none()
133
}
134
135
+
136
+/**
137
+ * A `File`, considered as a `Locatable`.
138
+ *
139
+ * For reasons of backwards compatibility, @file is a subtype of @locatable. This class exists to
140
+ * provide an override of `Locatable.getLocation()` for @files, since it would otherwise default
141
+ * to `none()`, which is unhelpful.
142
+ */
143
+private class FileLocatable extends File, Locatable {
144
+ override Location getLocation() { result = File.super.getLocation() }
145
+ override string toString() { result = File.super.toString() }
146
+}
0 commit comments