JS: introduce DataFlow::HtmlAttributeNode

This commit is contained in:
Esben Sparre Andreasen
2019-02-14 13:39:01 +01:00
parent da1ffcfd1b
commit 4c5e48fbbc

View File

@@ -40,7 +40,8 @@ module DataFlow {
} or
TDestructuredModuleImportNode(ImportDeclaration decl) {
exists(decl.getASpecifier().getImportedName())
}
} or
THtmlAttributeNode(HTML::Attribute attr)
/**
* A node in the data flow graph.
@@ -738,6 +739,27 @@ module DataFlow {
}
}
/**
* A data flow node representing an HTML attribute.
*/
private class HtmlAttributeNode extends DataFlow::Node, THtmlAttributeNode {
HTML::Attribute attr;
HtmlAttributeNode() { this = THtmlAttributeNode(attr) }
override string toString() { result = attr.toString() }
override ASTNode getAstNode() { none() }
override BasicBlock getBasicBlock() { none() }
override predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
attr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}
/**
* Provides classes representing various kinds of calls.
*