Skip to content

Commit 9b6c394

Browse files
authored
Merge pull request #2520 from max-schaefer/js/fix-2517
Approved by esbena
2 parents 12c11d0 + dfeca63 commit 9b6c394

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

javascript/ql/src/semmle/javascript/XML.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ abstract class XMLLocatable extends @xmllocatable {
3434
* both of which can contain other elements.
3535
*/
3636
class XMLParent extends @xmlparent {
37+
XMLParent() {
38+
// explicitly restrict `this` to be either an `XMLElement` or an `XMLFile`;
39+
// the type `@xmlparent` currently also includes non-XML files
40+
this instanceof @xmlelement or xmlEncoding(this, _)
41+
}
42+
3743
/**
3844
* Gets a printable representation of this XML parent.
3945
* (Intended to be overridden in subclasses.)

0 commit comments

Comments
 (0)