Add support for prototype methods in class instance member resolution

This commit is contained in:
Napalys Klicius
2025-04-28 15:17:26 +02:00
parent 4705d30bac
commit ee3a3bd9f5
2 changed files with 0 additions and 4 deletions

View File

@@ -1318,7 +1318,6 @@ module ClassNode {
)
or
// Function-style class methods via prototype
astNode instanceof Function and
kind = MemberKind::method() and
exists(DataFlow::SourceNode proto |
proto = this.getAPrototypeReference() and
@@ -1361,7 +1360,6 @@ module ClassNode {
)
or
// Function-style class methods via prototype
astNode instanceof Function and
kind = MemberKind::method() and
exists(DataFlow::SourceNode proto |
proto = this.getAPrototypeReference() and
@@ -1415,7 +1413,6 @@ module ClassNode {
* Only applies to function-style classes.
*/
DataFlow::SourceNode getAPrototypeReference() {
astNode instanceof Function and
(
exists(DataFlow::SourceNode base | base = getAFunctionValueWithPrototype(function) |
result = base.getAPropertyRead("prototype")

View File

@@ -2,7 +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:19:3:19:13 | baz.shout() | prototypes.js:11:23:11:35 | function() {} | -1 | calls |
badAnnotation
accessorCall
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |