class CollapseAnonymousFunctions extends java.lang.Object implements CompilerPass
var f = function()becomes:function f()This reduces the generated code size but changes the semantics because f will be defined before its definition is reached.
| Modifier and Type | Class and Description |
|---|---|
private class |
CollapseAnonymousFunctions.Callback |
| Modifier and Type | Field and Description |
|---|---|
private AbstractCompiler |
compiler |
| Constructor and Description |
|---|
CollapseAnonymousFunctions(AbstractCompiler compiler) |
| Modifier and Type | Method and Description |
|---|---|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
private final AbstractCompiler compiler
public CollapseAnonymousFunctions(AbstractCompiler compiler)
public void process(Node externs, Node root)
CompilerPassprocess in interface CompilerPassexterns - Top of external JS treeroot - Top of JS tree