Package com.google.javascript.jscomp
Class ParenthesizeFunctionsInChunks
- java.lang.Object
-
- com.google.javascript.jscomp.ParenthesizeFunctionsInChunks
-
- All Implemented Interfaces:
CompilerPass
public final class ParenthesizeFunctionsInChunks extends java.lang.Object implements CompilerPass
Marks all functions of specified chunks for eager parsing by adding the node property Node.MARK_FOR_PARENTHESIZE, which will wrap the fn in ().For non function expressions, we re-write the expression as follows:
- Before: function foo() { ... }
- After: var foo = (function() { ... })
A log file is created 'eager_compile_chunks.log' with output on how many functions were marked for eager compile for each specified chunk.
-
-
Constructor Summary
Constructors Constructor Description ParenthesizeFunctionsInChunks(AbstractCompiler compiler, java.util.Set<java.lang.String> parenthesizeFunctionsInChunks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
process(Node externs, Node root)
Process the JS with root node root.
-
-
-
Constructor Detail
-
ParenthesizeFunctionsInChunks
public ParenthesizeFunctionsInChunks(AbstractCompiler compiler, java.util.Set<java.lang.String> parenthesizeFunctionsInChunks)
-
-
Method Detail
-
process
public void process(Node externs, Node root)
Description copied from interface:CompilerPass
Process the JS with root node root. Can modify the contents of each Node tree- Specified by:
process
in interfaceCompilerPass
- Parameters:
externs
- Top of external JS treeroot
- Top of JS tree
-
-