mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Add test cases to verify correct call graph resolution with various JavaScript inheritance patterns
This commit is contained in:
@@ -2,6 +2,8 @@ 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:96:5:96:15 | this.read() | prototypes.js:104:27:104:39 | function() {} | -1 | calls |
|
||||
| prototypes.js:96:5:96:15 | this.read() | prototypes.js:109:27:109:39 | function() {} | -1 | calls |
|
||||
badAnnotation
|
||||
accessorCall
|
||||
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |
|
||||
|
||||
@@ -89,3 +89,21 @@ function barbar(bazExtented){
|
||||
}
|
||||
|
||||
barbar(new BazExtented());
|
||||
|
||||
class Base {
|
||||
constructor() {
|
||||
/** calls:Base.read calls:Derived1.read calls:Derived2.read */
|
||||
this.read();
|
||||
}
|
||||
/** name:Base.read */
|
||||
read() { }
|
||||
}
|
||||
|
||||
class Derived1 extends Base {}
|
||||
/** name:Derived1.read */
|
||||
Derived1.prototype.read = function() {};
|
||||
|
||||
class Derived2 {}
|
||||
Derived2.prototype = Object.create(Base.prototype);
|
||||
/** name:Derived2.read */
|
||||
Derived2.prototype.read = function() {};
|
||||
|
||||
Reference in New Issue
Block a user