mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
JS: Expose data flow node for field declaration
This commit is contained in:
@@ -1308,6 +1308,22 @@ module DataFlow {
|
||||
nd = TFunctionReturnNode(function)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use outside standard library.
|
||||
*
|
||||
* Gets a data flow node unique to the given field declaration.
|
||||
*
|
||||
* Note that this node defaults to being disconnected from the data flow
|
||||
* graph, as the individual property reads and writes affecting the field are
|
||||
* analyzed independently of the field declaration.
|
||||
*
|
||||
* Certain framework models may need this node to model the behavior of
|
||||
* class and field decorators.
|
||||
*/
|
||||
DataFlow::Node fieldDeclarationNode(FieldDeclaration field) {
|
||||
result = TPropNode(field)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the data flow node corresponding the given l-value expression, if
|
||||
* such a node exists.
|
||||
|
||||
@@ -293,7 +293,7 @@ module Angular2 {
|
||||
exists(FieldDeclaration f |
|
||||
f.getName() = name and
|
||||
f.getDeclaringClass().flow() = this and
|
||||
result = f.getNameExpr().flow()
|
||||
result = DataFlow::fieldDeclarationNode(f)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user