class RemoveUnusedPrototypeProperties extends java.lang.Object implements CompilerPass
| Modifier and Type | Field and Description |
|---|---|
private boolean |
anchorUnusedVars |
private boolean |
canModifyExterns |
private AbstractCompiler |
compiler |
private static java.util.logging.Logger |
logger |
| Constructor and Description |
|---|
RemoveUnusedPrototypeProperties(AbstractCompiler compiler,
boolean canModifyExterns,
boolean anchorUnusedVars)
Creates a new pass for removing unused prototype properties, based
on the uniqueness of property names.
|
| Modifier and Type | Method and Description |
|---|---|
void |
process(Node externRoot,
Node root)
Process the JS with root node root.
|
private static final java.util.logging.Logger logger
private final AbstractCompiler compiler
private final boolean canModifyExterns
private final boolean anchorUnusedVars
RemoveUnusedPrototypeProperties(AbstractCompiler compiler, boolean canModifyExterns, boolean anchorUnusedVars)
compiler - The compiler.canModifyExterns - If true, then we can remove prototype
properties that are declared in the externs file.anchorUnusedVars - If true, then we must keep unused variables
and the prototype properties they reference, even if they are
never used.public void process(Node externRoot, Node root)
CompilerPassprocess in interface CompilerPassexternRoot - Top of external JS treeroot - Top of JS tree