Update javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll

Commit coding style suggestion

Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
This commit is contained in:
JrXnm
2021-12-13 18:32:11 +08:00
committed by GitHub
parent 1a1a7413c2
commit fad95d8935

View File

@@ -203,19 +203,14 @@ class LocalFunction extends Function {
DataFlow::Impl::ExplicitInvokeNode invk;
LocalFunction() {
(
exists(LocalVariable v |
getOnlyAccess(this, v) = invk.getCalleeNode().asExpr() and
not exists(v.getAnAssignedExpr()) and
not exists(ExportDeclaration export | export.exportsAs(v, _))
)
or
exists(LocalVariable v |
getOnlyAccessToFunctionExpr(this, v) = invk.getCalleeNode().asExpr() and
not exists(ExportDeclaration export | export.exportsAs(v, _))
)
)
and
exists(LocalVariable v |
getOnlyAccess(this, v) = invk.getCalleeNode().asExpr() and
not exists(v.getAnAssignedExpr()) and
not exists(ExportDeclaration export | export.exportsAs(v, _))
or
getOnlyAccessToFunctionExpr(this, v) = invk.getCalleeNode().asExpr() and
not exists(ExportDeclaration export | export.exportsAs(v, _))
) and
// if the function is non-strict and its `arguments` object is accessed, we
// also assume that there may be other calls (through `arguments.callee`)
(isStrict() or not usesArgumentsObject())