Add test cases to verify correct call graph resolution with various JavaScript inheritance patterns

This commit is contained in:
Napalys Klicius
2025-04-29 13:04:07 +02:00
parent 0a9a7911c2
commit c8ee8dce98
2 changed files with 20 additions and 0 deletions

View File

@@ -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 | () {} |

View File

@@ -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() {};