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 44
55import javascript
66private import semmle.javascript.internal.CachedStages
7+ private import semmle.javascript.internal.TypeResolution
78
89/**
910 * A program element that is either an expression or a type annotation.
@@ -1017,7 +1018,11 @@ class InvokeExpr extends @invokeexpr, Expr {
10171018 * Note that the resolved function may be overridden in a subclass and thus is not
10181019 * necessarily the actual target of this invocation at runtime.
10191020 */
1020- Function getResolvedCallee ( ) { result = this .getResolvedCalleeName ( ) .getImplementation ( ) }
1021+ Function getResolvedCallee ( ) {
1022+ TypeResolution:: callTarget ( this , result )
1023+ or
1024+ result = this .getResolvedCalleeName ( ) .getImplementation ( )
1025+ }
10211026}
10221027
10231028/**
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ module TypeResolution {
111111 member .( AST:: ValueNode ) .flow ( ) , contents )
112112 }
113113
114- private predicate callTarget ( InvokeExpr call , Function target ) {
114+ predicate callTarget ( InvokeExpr call , Function target ) {
115115 exists ( ClassDefinition cls |
116116 valueHasType ( call .( NewExpr ) .getCallee ( ) , trackClassValue ( cls ) ) and
117117 target = cls .getConstructor ( ) .getBody ( )
You can’t perform that action at this time.
0 commit comments