mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Add call graph tests for prototype methods injected on class
This commit is contained in:
@@ -2,6 +2,7 @@ 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 | () {} |
|
||||
|
||||
25
javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/prototypes.js
vendored
Normal file
25
javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/prototypes.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
class Baz {
|
||||
baz() {
|
||||
/** calls:Baz.greet */
|
||||
this.greet();
|
||||
}
|
||||
/** name:Baz.greet */
|
||||
greet() {}
|
||||
}
|
||||
|
||||
/** name:Baz.shout */
|
||||
Baz.prototype.shout = function() {};
|
||||
/** name:Baz.staticShout */
|
||||
Baz.staticShout = function() {};
|
||||
|
||||
function foo(baz){
|
||||
/** calls:Baz.greet */
|
||||
baz.greet();
|
||||
/** calls:Baz.shout */
|
||||
baz.shout();
|
||||
/** calls:Baz.staticShout */
|
||||
Baz.staticShout();
|
||||
}
|
||||
|
||||
const baz = new Baz();
|
||||
foo(baz);
|
||||
Reference in New Issue
Block a user