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

Class AnalyzedVarDef

A vardef with helper predicates for flow analysis.

Import path

import javascript

Direct supertypes

Indirect supertypes

Known direct subtypes

    Predicates

    getAnAssignedValue

    Gets an abstract value that this variable definition may assign to its target, including indefinite values if this definition cannot be analyzed completely.

    getAnRhsValue

    Gets an abstract value that the right hand side of this VarDef may evaluate to.

    getRhs

    Gets a node representing the value of the right hand side of this VarDef.

    getTopLevel

    Gets the toplevel syntactic unit to which this definition belongs.

    isIncomplete

    Holds if flow analysis results for this node may be incomplete due to the given cause.

    Inherited predicates

    describeControlFlowNode

    For internal use.

    from ControlFlowNode
    getAPredecessor

    Gets a node preceding this node in the CFG.

    from ControlFlowNode
    getAPrimaryQlClass

    Gets the primary QL class for the Locatable.

    from Locatable
    getASuccessor

    Gets a node succeeding this node in the CFG.

    from ControlFlowNode
    getAVariable

    Gets a variable defined by this node, if any.

    from VarDef
    getBasicBlock

    Gets the basic block this node belongs to.

    from ControlFlowNode
    getContainer

    Gets the function or toplevel to which this node belongs.

    from NodeInStmtContainer
    getDestructuringSource

    Gets the source that this definition destructs, that is, the right hand side of a destructuring assignment.

    from VarDef
    getEndLine

    Gets the line on which this element ends.

    from Locatable
    getFile

    Gets the file this program element comes from.

    from Locatable
    getLocation

    Gets this element’s location.

    from Locatable
    getNumLines

    Gets the number of lines covered by this element.

    from Locatable
    getPrimaryQlClasses

    Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

    from Locatable
    getSource

    Gets the source of this definition, that is, the data flow node representing the value that this definition assigns to its target.

    from VarDef
    getStartLine

    Gets the line on which this element starts.

    from Locatable
    getTarget

    Gets the target of this definition, which is either a simple variable reference, a destructuring pattern, or a property access.

    from VarDef
    isAFinalNode

    Holds if this is a final node, that is, a CFG node where execution of a toplevel or function terminates.

    from ControlFlowNode
    isAFinalNodeOfContainer

    Holds if this is a final node of container, that is, a CFG node where execution of that toplevel or function terminates.

    from ControlFlowNode
    isBranch

    Holds if this is a node with more than one successor.

    from ControlFlowNode
    isJoin

    Holds if this is a node with more than one predecessor.

    from ControlFlowNode
    isOverwritten

    Holds if this definition of v is overwritten by another definition, that is, another definition of v is reachable from it in the CFG.

    from VarDef
    isStart

    Holds if this is a start node, that is, the CFG node where execution of a toplevel or function begins.

    from ControlFlowNode
    isUnreachable

    Holds if this node is unreachable, that is, it has no predecessors in the CFG. Entry nodes are always considered reachable.

    from ControlFlowNode
    toString

    Gets a textual representation of this element.

    from Locatable