@@ -23,31 +23,27 @@ private import semmle.javascript.internal.CachedStages
2323 * ```
2424 */
2525class AstNode extends @ast_node, NodeInStmtContainer {
26- override Location getLocation ( ) { hasLocation ( this , result ) }
27-
2826 override File getFile ( ) {
2927 result = this .getLocation ( ) .getFile ( ) // Specialized for performance reasons
3028 }
3129
3230 /** Gets the first token belonging to this element. */
3331 Token getFirstToken ( ) {
34- exists ( Location l1 , Location l2 |
32+ exists ( DbLocation l1 , DbLocation l2 , string filepath , int startline , int startcolumn |
3533 l1 = this .getLocation ( ) and
3634 l2 = result .getLocation ( ) and
37- l1 .getFile ( ) = l2 .getFile ( ) and
38- l1 .getStartLine ( ) = l2 .getStartLine ( ) and
39- l1 .getStartColumn ( ) = l2 .getStartColumn ( )
35+ l1 .hasLocationInfo ( filepath , startline , startcolumn , _, _) and
36+ l2 .hasLocationInfo ( filepath , startline , startcolumn , _, _)
4037 )
4138 }
4239
4340 /** Gets the last token belonging to this element. */
4441 Token getLastToken ( ) {
45- exists ( Location l1 , Location l2 |
42+ exists ( DbLocation l1 , DbLocation l2 , string filepath , int endline , int endcolumn |
4643 l1 = this .getLocation ( ) and
4744 l2 = result .getLocation ( ) and
48- l1 .getFile ( ) = l2 .getFile ( ) and
49- l1 .getEndLine ( ) = l2 .getEndLine ( ) and
50- l1 .getEndColumn ( ) = l2 .getEndColumn ( )
45+ l1 .hasLocationInfo ( filepath , _, _, endline , endcolumn ) and
46+ l2 .hasLocationInfo ( filepath , _, _, endline , endcolumn )
5147 ) and
5248 // exclude empty EOF token
5349 not result instanceof EOFToken
0 commit comments