@@ -138,14 +138,17 @@ module Vue {
138138 /** Gets a textual representation of this element. */
139139 string toString ( ) { none ( ) } // overridden in subclasses
140140
141+ /** Gets the location of this component. */
142+ Location getLocation ( ) { none ( ) } // overridden in subclasses
143+
141144 /**
142145 * Holds if this element is at the specified location.
143146 * The location spans column `startcolumn` of line `startline` to
144147 * column `endcolumn` of line `endline` in file `filepath`.
145148 * For more information, see
146149 * [locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
147150 */
148- predicate hasLocationInfo (
151+ deprecated predicate hasLocationInfo (
149152 string filepath , int startline , int startcolumn , int endline , int endcolumn
150153 ) {
151154 filepath = "" and
@@ -350,11 +353,7 @@ module Vue {
350353
351354 override string toString ( ) { result = def .toString ( ) }
352355
353- override predicate hasLocationInfo (
354- string filepath , int startline , int startcolumn , int endline , int endcolumn
355- ) {
356- def .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
357- }
356+ override Location getLocation ( ) { result = def .getLocation ( ) }
358357
359358 override API:: Node getComponentRef ( ) {
360359 // The Vue.extend call is made in the Vue framework; there is no explicit reference
@@ -383,11 +382,7 @@ module Vue {
383382
384383 override string toString ( ) { result = extend .toString ( ) }
385384
386- override predicate hasLocationInfo (
387- string filepath , int startline , int startcolumn , int endline , int endcolumn
388- ) {
389- extend .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
390- }
385+ override Location getLocation ( ) { result = extend .getLocation ( ) }
391386
392387 override API:: Node getComponentRef ( ) { result = extend .getReturn ( ) }
393388
@@ -412,11 +407,7 @@ module Vue {
412407
413408 override string toString ( ) { result = def .toString ( ) }
414409
415- override predicate hasLocationInfo (
416- string filepath , int startline , int startcolumn , int endline , int endcolumn
417- ) {
418- def .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
419- }
410+ override Location getLocation ( ) { result = def .getLocation ( ) }
420411
421412 override API:: Node getComponentRef ( ) {
422413 // The component can be obtained via 1-argument calls to `Vue.component()` with the
@@ -477,15 +468,7 @@ module Vue {
477468 )
478469 }
479470
480- override predicate hasLocationInfo (
481- string filepath , int startline , int startcolumn , int endline , int endcolumn
482- ) {
483- filepath = file .getAbsolutePath ( ) and
484- startline = 0 and
485- startcolumn = 0 and
486- endline = 0 and
487- endcolumn = 0
488- }
471+ override Location getLocation ( ) { result = file .getLocation ( ) }
489472
490473 /** Gets the module defined by the `script` tag in this .vue file, if any. */
491474 Module getModule ( ) { result = getModuleFromVueFile ( file ) }
@@ -622,11 +605,7 @@ module Vue {
622605
623606 HtmlElement ( ) { this = MkHtmlElement ( elem ) }
624607
625- override predicate hasLocationInfo (
626- string filepath , int startline , int startcolumn , int endline , int endcolumn
627- ) {
628- elem .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
629- }
608+ Location getLocation ( ) { result = elem .getLocation ( ) }
630609
631610 override string getName ( ) { result = elem .getName ( ) }
632611
0 commit comments