Fix class instance method detection in constructor receiver

This commit is contained in:
Napalys Klicius
2025-05-01 08:15:26 +02:00
parent 7430d0e5e0
commit 9bab59363c
2 changed files with 6 additions and 2 deletions

View File

@@ -1330,6 +1330,9 @@ module ClassNode {
accessor.getName() = name and
result = accessor.getInit().flow()
)
or
kind = MemberKind::method() and
result = this.getConstructor().getReceiver().getAPropertySource(name)
}
override FunctionNode getAnInstanceMember(MemberKind kind) {
@@ -1362,6 +1365,9 @@ module ClassNode {
accessor = this.getAnAccessor(kind) and
result = accessor.getInit().flow()
)
or
kind = MemberKind::method() and
result = this.getConstructor().getReceiver().getAPropertySource()
}
override FunctionNode getStaticMember(string name, MemberKind kind) {

View File

@@ -2,8 +2,6 @@ spuriousCallee
missingCallee
| constructor-field.ts:40:5:40:14 | f3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
| constructor-field.ts:71:1:71:11 | bf3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
| prototypes.js:117:5:117:19 | this.tmpClass() | prototypes.js:113:1:113:22 | functio ... ss() {} | -1 | calls |
| prototypes.js:131:5:131:23 | this.tmpPrototype() | prototypes.js:127:1:127:26 | functio ... pe() {} | -1 | calls |
badAnnotation
accessorCall
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |