class InlineObjectLiterals extends java.lang.Object implements CompilerPass
ReferenceCollectingCallback
,
identify variables that are only ever assigned to object literals
and that are never used in entirety, and expand the objects into
individual variables.
Based on the InlineVariables passModifier and Type | Class and Description |
---|---|
private class |
InlineObjectLiterals.InliningBehavior
Builds up information about nodes in each scope.
|
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
private com.google.common.base.Supplier<java.lang.String> |
safeNameIdSupplier |
static java.lang.String |
VAR_PREFIX |
Constructor and Description |
---|
InlineObjectLiterals(AbstractCompiler compiler,
com.google.common.base.Supplier<java.lang.String> safeNameIdSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
public static final java.lang.String VAR_PREFIX
private final AbstractCompiler compiler
private final com.google.common.base.Supplier<java.lang.String> safeNameIdSupplier
InlineObjectLiterals(AbstractCompiler compiler, com.google.common.base.Supplier<java.lang.String> safeNameIdSupplier)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS tree