JS: Specialize ASTNode.getFile

This commit is contained in:
Asger Feldthaus
2020-04-09 10:47:15 +01:00
parent 244a304e1d
commit 5da968e34c

View File

@@ -23,6 +23,10 @@ import javascript
class ASTNode extends @ast_node, Locatable {
override Location getLocation() { hasLocation(this, result) }
override File getFile() {
result = getLocation().getFile() // Specialized for performance reasons
}
/** Gets the first token belonging to this element. */
Token getFirstToken() {
exists(Location l1, Location l2 |