JS: Add DataFlow::Node.getLocation

This commit is contained in:
Tom Hvitved
2024-03-12 11:08:18 +01:00
parent 35a8e7cbf0
commit 16cef92106
22 changed files with 235 additions and 97 deletions

View File

@@ -43,8 +43,6 @@ module HTML {
class Element extends Locatable, @xmlelement {
Element() { exists(FileContainingHtml f | xmlElements(this, _, _, _, f)) }
override Location getLocation() { xmllocations(this, result) }
/**
* Gets the name of this HTML element.
*
@@ -122,8 +120,6 @@ module HTML {
class Attribute extends Locatable, @xmlattribute {
Attribute() { exists(FileContainingHtml f | xmlAttrs(this, _, _, _, _, f)) }
override Location getLocation() { xmllocations(this, result) }
/**
* Gets the inline script of this attribute, if any.
*/
@@ -326,8 +322,6 @@ module HTML {
* Holds if this text node is inside a `CDATA` tag.
*/
predicate isCData() { xmlChars(this, _, _, _, 1, _) }
override Location getLocation() { xmllocations(this, result) }
}
/**
@@ -349,7 +343,5 @@ module HTML {
string getText() { result = this.toString().regexpCapture("(?s)<!--(.*)-->", 1) }
override string toString() { xmlComments(this, result, _, _) }
override Location getLocation() { xmllocations(this, result) }
}
}