Skip to content

Commit c993f9a

Browse files
committed
add instance methods in the same class to localFieldStep
1 parent ea6d3bd commit c993f9a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,9 @@ module DataFlow {
15451545
*/
15461546
predicate localFieldStep(DataFlow::Node pred, DataFlow::Node succ) {
15471547
exists(ClassNode cls, string prop |
1548-
pred = cls.getAReceiverNode().getAPropertyWrite(prop).getRhs() and
1548+
pred = cls.getAReceiverNode().getAPropertyWrite(prop).getRhs() or
1549+
pred = cls.getInstanceMethod(prop)
1550+
|
15491551
succ = cls.getAReceiverNode().getAPropertyRead(prop)
15501552
)
15511553
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Foo {
2+
foo() {} // name: foo
3+
4+
bar() {
5+
this.foo; // track: foo
6+
}
7+
}

0 commit comments

Comments
 (0)