Make use of getContainer

This commit is contained in:
Robert Brignull 2020-05-04 15:16:23 +01:00
parent d90fca396a
commit dcd81b5847

View file

@ -36,7 +36,7 @@ class ActionDeclaration extends File {
} }
Expr getAFunctionChildExpr(Function f) { Expr getAFunctionChildExpr(Function f) {
result = f.getBody().getAChildStmt*().getAChildExpr*() result.getContainer() = f
} }
/* /*
@ -44,6 +44,8 @@ Expr getAFunctionChildExpr(Function f) {
*/ */
Function calledBy(Function f) { Function calledBy(Function f) {
result = getAFunctionChildExpr(f).(InvokeExpr).getResolvedCallee() result = getAFunctionChildExpr(f).(InvokeExpr).getResolvedCallee()
or
result.getEnclosingContainer() = f // assume outer function causes inner function to be called
} }
class GetInputMethodCallExpr extends MethodCallExpr { class GetInputMethodCallExpr extends MethodCallExpr {