public class SimpleDefinitionFinder extends Object implements CompilerPass
DefinitionProvider
.
It treats all variable writes as happening in the global scope and
treats all objects as capable of having the same set of properties.
The current implementation only handles definitions whose right
hand side is an immutable value or function expression. All
complex definitions are treated as unknowns.Modifier and Type | Field and Description |
---|---|
static String |
EXTERN_OBJECT_PROPERTY_STRING |
Constructor and Description |
---|
SimpleDefinitionFinder(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
Collection<com.google.javascript.jscomp.DefinitionSite> |
getDefinitionSites()
Returns the collection of definition sites found during traversal.
|
Collection<com.google.javascript.jscomp.DefinitionsRemover.Definition> |
getDefinitionsReferencedAt(Node useSite)
Returns a collection of definitions that characterize the
possible values of a variable or property.
|
void |
process(Node externs,
Node source)
Process the JS with root node root.
|
public static final String EXTERN_OBJECT_PROPERTY_STRING
public SimpleDefinitionFinder(AbstractCompiler compiler)
public Collection<com.google.javascript.jscomp.DefinitionSite> getDefinitionSites()
public Collection<com.google.javascript.jscomp.DefinitionsRemover.Definition> getDefinitionsReferencedAt(Node useSite)
public void process(Node externs, Node source)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treesource
- Top of JS treeCopyright © 2009-2016 Google. All Rights Reserved.