Skip to content

Commit ee3a3bd

Browse files
committed
Add support for prototype methods in class instance member resolution
1 parent 4705d30 commit ee3a3bd

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,6 @@ module ClassNode {
13181318
)
13191319
or
13201320
// Function-style class methods via prototype
1321-
astNode instanceof Function and
13221321
kind = MemberKind::method() and
13231322
exists(DataFlow::SourceNode proto |
13241323
proto = this.getAPrototypeReference() and
@@ -1361,7 +1360,6 @@ module ClassNode {
13611360
)
13621361
or
13631362
// Function-style class methods via prototype
1364-
astNode instanceof Function and
13651363
kind = MemberKind::method() and
13661364
exists(DataFlow::SourceNode proto |
13671365
proto = this.getAPrototypeReference() and
@@ -1415,7 +1413,6 @@ module ClassNode {
14151413
* Only applies to function-style classes.
14161414
*/
14171415
DataFlow::SourceNode getAPrototypeReference() {
1418-
astNode instanceof Function and
14191416
(
14201417
exists(DataFlow::SourceNode base | base = getAFunctionValueWithPrototype(function) |
14211418
result = base.getAPropertyRead("prototype")

javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/Test.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ spuriousCallee
22
missingCallee
33
| constructor-field.ts:40:5:40:14 | f3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
44
| constructor-field.ts:71:1:71:11 | bf3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
5-
| prototypes.js:19:3:19:13 | baz.shout() | prototypes.js:11:23:11:35 | function() {} | -1 | calls |
65
badAnnotation
76
accessorCall
87
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |

0 commit comments

Comments
 (0)