Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b20ce8b

Browse files
committed
use callgraph instead of TypeInference in Testing.qll
1 parent 79839d2 commit b20ce8b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • javascript/ql/src/semmle/javascript/frameworks

javascript/ql/src/semmle/javascript/frameworks/Testing.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BDDTest extends Test, @call_expr {
3333
exists(CallExpr call | call = this |
3434
call.getCallee().(VarAccess).getName() = "it" and
3535
exists(call.getArgument(0).getStringValue()) and
36-
call.getArgument(1).analyze().getAValue() instanceof AbstractFunction
36+
exists(call.getArgument(1).flow().getAFunctionValue(0))
3737
)
3838
}
3939
}
@@ -60,7 +60,7 @@ class JestTest extends Test, @call_expr {
6060
exists(CallExpr call | call = this |
6161
call.getCallee().(GlobalVarAccess).getName() = "test" and
6262
exists(call.getArgument(0).getStringValue()) and
63-
call.getArgument(1).analyze().getAValue() instanceof AbstractFunction
63+
exists(call.getArgument(1).flow().getAFunctionValue(0))
6464
) and
6565
getFile() = getTestFile(any(File f), "test")
6666
}
@@ -94,7 +94,7 @@ class CucumberTest extends Test, @call_expr {
9494
exists(DataFlow::ModuleImportNode m, CallExpr call |
9595
m.getPath() = "cucumber" and
9696
call = m.getAnInvocation().asExpr() and
97-
call.getArgument(0).analyze().getAValue() instanceof AbstractFunction and
97+
exists(call.getArgument(0).flow().getAFunctionValue()) and
9898
this = call
9999
)
100100
}

0 commit comments

Comments
 (0)