Skip to content

Commit fad95d8

Browse files
SZFsirerik-krogh
andauthored
Update javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll
Commit coding style suggestion Co-authored-by: Erik Krogh Kristensen <[email protected]>
1 parent 1a1a741 commit fad95d8

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,14 @@ class LocalFunction extends Function {
203203
DataFlow::Impl::ExplicitInvokeNode invk;
204204

205205
LocalFunction() {
206-
(
207-
exists(LocalVariable v |
208-
getOnlyAccess(this, v) = invk.getCalleeNode().asExpr() and
209-
not exists(v.getAnAssignedExpr()) and
210-
not exists(ExportDeclaration export | export.exportsAs(v, _))
211-
)
212-
or
213-
exists(LocalVariable v |
214-
getOnlyAccessToFunctionExpr(this, v) = invk.getCalleeNode().asExpr() and
215-
not exists(ExportDeclaration export | export.exportsAs(v, _))
216-
)
217-
)
218-
and
206+
exists(LocalVariable v |
207+
getOnlyAccess(this, v) = invk.getCalleeNode().asExpr() and
208+
not exists(v.getAnAssignedExpr()) and
209+
not exists(ExportDeclaration export | export.exportsAs(v, _))
210+
or
211+
getOnlyAccessToFunctionExpr(this, v) = invk.getCalleeNode().asExpr() and
212+
not exists(ExportDeclaration export | export.exportsAs(v, _))
213+
) and
219214
// if the function is non-strict and its `arguments` object is accessed, we
220215
// also assume that there may be other calls (through `arguments.callee`)
221216
(isStrict() or not usesArgumentsObject())

0 commit comments

Comments
 (0)