CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.2.1-dev (changelog, source)
Search

Module CachedSteps

Implements a set of data flow predicates that are used by multiple predicates and hence should only be computed once.

Import path

import semmle.javascript.dataflow.internal.FlowSteps

Predicates

argumentPassing

Holds if arg is passed as an argument into parameter parm through invocation invk of function f.

basicLoadStep

Holds if there is a load step from pred to succ under property prop, that is, succ is a read of property prop from pred.

basicStoreStep

Holds if there is a store step from pred to succ under property prop, that is, succ is the local source of the base of a write of property prop with right-hand side pred.

callStep

Holds if there is a flow step from pred to succ through parameter passing to a function call.

calls

Holds if invk may invoke f.

callsBound

Holds if invk may invoke a bound version of f with boundArgs already bound.

captures

Holds if f captures the given variable in cap.

exploratoryBoundInvokeStep

Holds if pred may flow to succ through an invocation of a bound function.

exploratoryCallbackStep

Holds if there is a higher-order call with argument arg, and cb is the local source of an argument that flows into the callee position of that call:

getACallbackSource

Gets a function that flows to parameter via one or more parameter-passing steps.

getCapturedVariableDepth

Gets the nesting depth of the container declaring the given captured variable.

getContainerDepth

Gets the nesting depth of the given container, starting with the top-level at 0.

globalFlowStep

Holds if there is a flow step from pred to succ through a global variable. Both pred and succ must be in the same file.

identityFunctionStep

Holds if there is a step from pred to succ through a call to an identity function.

propertyFlowStep

Holds if there is a flow step from pred to succ through an object property.

receiverPropWrite

Holds if f may assign rhs to this.prop.

returnStep

Holds if there is a flow step from pred to succ through: - returning a value from a function call (from the special FunctionReturnNode), or - throwing an exception out of a function call, or - the receiver flowing out of a constructor call.

returnedPropWrite

Holds if f may return base, which has a write of property prop with right-hand side rhs.