JS: Add an use getAPropertySource()

This commit is contained in:
Asger F
2019-07-01 12:00:32 +01:00
parent 5ce08e2c78
commit 329ff0db1b
2 changed files with 10 additions and 3 deletions

View File

@@ -879,10 +879,10 @@ module ClassNode {
override FunctionNode getAnInstanceMember(MemberKind kind) {
kind = MemberKind::method() and
result = getAPrototypeReference().getAPropertyWrite().getRhs().getALocalSource()
result = getAPrototypeReference().getAPropertySource()
or
kind = MemberKind::method() and
result = getConstructor().getReceiver().getAPropertyWrite().getRhs().getALocalSource()
result = getConstructor().getReceiver().getAPropertySource()
or
exists(PropertyAccessor accessor |
accessor = getAnAccessor(kind) and
@@ -893,7 +893,7 @@ module ClassNode {
override FunctionNode getStaticMethod(string name) { result = getAPropertySource(name) }
override FunctionNode getAStaticMethod() {
result = getAPropertyWrite().getRhs().getALocalSource()
result = getAPropertySource()
}
/**

View File

@@ -155,6 +155,13 @@ class SourceNode extends DataFlow::Node {
result.flowsTo(getAPropertyWrite(prop).getRhs())
}
/**
* Gets a source node whose value is stored in a property of this node.
*/
DataFlow::SourceNode getAPropertySource() {
result.flowsTo(getAPropertyWrite().getRhs())
}
/**
* EXPERIMENTAL.
*