зеркало из https://github.com/github/codeql.git
JS: add PropWrite instance for parameter fields
This commit is contained in:
Родитель
dacde5da12
Коммит
7a4af4af6d
|
@ -512,6 +512,25 @@ module DataFlow {
|
|||
override ControlFlowNode getWriteNode() { result = prop }
|
||||
}
|
||||
|
||||
/**
|
||||
* A field induced by an initializing constructor parameter, seen as a property write (TypeScript only).
|
||||
*/
|
||||
private class ParameterFieldAsPropWrite extends PropWrite, PropNode {
|
||||
override ParameterField prop;
|
||||
|
||||
override Node getBase() {
|
||||
result = thisNode(prop.getDeclaringClass().getConstructor().getBody())
|
||||
}
|
||||
|
||||
override Expr getPropertyNameExpr() { result = prop.getNameExpr() }
|
||||
|
||||
override string getPropertyName() { result = prop.getName() }
|
||||
|
||||
override Node getRhs() { result = parameterNode(prop.getParameter()) }
|
||||
|
||||
override ControlFlowNode getWriteNode() { result = prop.getParameter() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A data flow node that reads an object property.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче