com.google.javascript.jscomp
Class CallGraph.Callsite

java.lang.Object
  extended by com.google.javascript.jscomp.CallGraph.Callsite
Enclosing class:
CallGraph

public class CallGraph.Callsite
extends Object

An inner class that represents call sites in the call graph. A Callsite knows how to get its AST node, what its containing Function is, and what its target Functions are.


Method Summary
 Node getAstNode()
           
 CallGraph.Function getContainingFunction()
           
 Collection<CallGraph.Function> getPossibleTargets()
          Returns the possible target functions that this callsite could call.
 boolean hasExternTarget()
          If true, then this callsite could target a function defined in the externs.
 boolean hasUnknownTarget()
          If true, then DefinitionProvider used in callgraph construction was unable find all target functions of this callsite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAstNode

public Node getAstNode()

getContainingFunction

public CallGraph.Function getContainingFunction()

getPossibleTargets

public Collection<CallGraph.Function> getPossibleTargets()
Returns the possible target functions that this callsite could call. These targets do not include functions defined in externs. If this callsite could call an extern function, then hasExternTarget() will return true. getKnownTargets() is a best effort only: the collection may include other functions that are not actual targets and (if hasUnknownTargets() is true) may be missing actual targets. This method should not be called on a Callsite from a CallGraph that was constructed with computeForwardGraph false.


hasUnknownTarget

public boolean hasUnknownTarget()
If true, then DefinitionProvider used in callgraph construction was unable find all target functions of this callsite. If false, then getKnownTargets() contains all the possible targets of this callsite (and, perhaps, additional targets as well).


hasExternTarget

public boolean hasExternTarget()
If true, then this callsite could target a function defined in the externs. If false, then not.