mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Add support for prototype methods in class instance member resolution
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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 | () {} |
|
||||
|
||||
Reference in New Issue
Block a user