File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import javascript
6
6
private import semmle.javascript.internal.CachedStages
7
+ private import semmle.javascript.internal.TypeResolution
7
8
8
9
/**
9
10
* A program element that is either an expression or a type annotation.
@@ -1017,7 +1018,11 @@ class InvokeExpr extends @invokeexpr, Expr {
1017
1018
* Note that the resolved function may be overridden in a subclass and thus is not
1018
1019
* necessarily the actual target of this invocation at runtime.
1019
1020
*/
1020
- Function getResolvedCallee ( ) { result = this .getResolvedCalleeName ( ) .getImplementation ( ) }
1021
+ Function getResolvedCallee ( ) {
1022
+ TypeResolution:: callTarget ( this , result )
1023
+ or
1024
+ result = this .getResolvedCalleeName ( ) .getImplementation ( )
1025
+ }
1021
1026
}
1022
1027
1023
1028
/**
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ module TypeResolution {
111
111
member .( AST:: ValueNode ) .flow ( ) , contents )
112
112
}
113
113
114
- private predicate callTarget ( InvokeExpr call , Function target ) {
114
+ predicate callTarget ( InvokeExpr call , Function target ) {
115
115
exists ( ClassDefinition cls |
116
116
valueHasType ( call .( NewExpr ) .getCallee ( ) , trackClassValue ( cls ) ) and
117
117
target = cls .getConstructor ( ) .getBody ( )
You can’t perform that action at this time.
0 commit comments