Skip to content

Commit 5da968e

Browse files
committed
JS: Specialize ASTNode.getFile
1 parent 244a304 commit 5da968e

File tree

1 file changed

+4
-0
lines changed
  • javascript/ql/src/semmle/javascript

1 file changed

+4
-0
lines changed

javascript/ql/src/semmle/javascript/AST.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import javascript
2323
class ASTNode extends @ast_node, Locatable {
2424
override Location getLocation() { hasLocation(this, result) }
2525

26+
override File getFile() {
27+
result = getLocation().getFile() // Specialized for performance reasons
28+
}
29+
2630
/** Gets the first token belonging to this element. */
2731
Token getFirstToken() {
2832
exists(Location l1, Location l2 |

0 commit comments

Comments
 (0)