Package com.google.javascript.jscomp
Class CallGraph.Function
java.lang.Object
com.google.javascript.jscomp.CallGraph.Function
- Enclosing class:
- CallGraph
An inner class that represents functions in the call graph.
A Function knows how to get its AST node and what Callsites
it contains.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying AST node for the function.Returns the AST node for the body of the function.Returns the callsites in this function.Returns a collection of callsites that might call this function.getName()
Gets the name of this function.boolean
Returns true if the function is aliased.boolean
Returns true if the function is ever exposed to ".call" or ".apply".boolean
isMain()
Does this function represent the global "main" function?
-
Method Details
-
isMain
public boolean isMain()Does this function represent the global "main" function? -
getAstNode
Returns the underlying AST node for the function. This usually has type Token.FUNCTION but in the case of the "main" function will have type Token.BLOCK. -
getBodyNode
Returns the AST node for the body of the function. If this function is the main function, it will return the global block. -
getName
Gets the name of this function. Returns null if the function is anonymous. -
getCallsitesInFunction
Returns the callsites in this function. -
getCallsitesPossiblyTargetingFunction
Returns a collection of callsites that might call this function. getCallsitesPossiblyTargetingFunction() is a best effort only: the collection may include callsites that do not actually call this function and if this function is exported or aliased may be missing actual targets. This method should not be called on a Function from a CallGraph that was constructed withcomputeBackwardGraph
false
. -
isAliased
public boolean isAliased()Returns true if the function is aliased. -
isExposedToCallOrApply
public boolean isExposedToCallOrApply()Returns true if the function is ever exposed to ".call" or ".apply".
-