class Normalize extends java.lang.Object implements CompilerPass
Modifier and Type | Class and Description |
---|---|
private class |
Normalize.DuplicateDeclarationHandler
ScopeCreator duplicate declaration handler.
|
private static class |
Normalize.FindExposeAnnotations
Find all the @expose annotations.
|
(package private) static class |
Normalize.NormalizeStatements
Simplify the AST:
- VAR declarations split, so they represent exactly one child
declaration.
|
(package private) static class |
Normalize.PropagateConstantAnnotationsOverVars
Propagate constant annotations over the Var graph.
|
private class |
Normalize.RewriteExposedProperties
Rewrite all exposed properties in [] form.
|
private static class |
Normalize.ScopeTicklingCallback
A simple class that causes scope to be created.
|
(package private) static class |
Normalize.VerifyConstants
Walk the AST tree and verify that constant names are used consistently.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
assertOnChange |
static DiagnosticType |
CATCH_BLOCK_VAR_ERROR |
private AbstractCompiler |
compiler |
private static boolean |
CONVERT_WHILE_TO_FOR |
(package private) static boolean |
MAKE_LOCAL_NAMES_UNIQUE |
Constructor and Description |
---|
Normalize(AbstractCompiler compiler,
boolean assertOnChange) |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
normalizeSyntheticCode(AbstractCompiler compiler,
Node js,
java.lang.String prefix) |
(package private) static Node |
parseAndNormalizeTestCode(AbstractCompiler compiler,
java.lang.String code) |
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
private void |
removeDuplicateDeclarations(Node externs,
Node root)
Remove duplicate VAR declarations.
|
private void |
reportCodeChange(java.lang.String changeDescription) |
private final AbstractCompiler compiler
private final boolean assertOnChange
private static final boolean CONVERT_WHILE_TO_FOR
static final boolean MAKE_LOCAL_NAMES_UNIQUE
public static final DiagnosticType CATCH_BLOCK_VAR_ERROR
Normalize(AbstractCompiler compiler, boolean assertOnChange)
static void normalizeSyntheticCode(AbstractCompiler compiler, Node js, java.lang.String prefix)
static Node parseAndNormalizeTestCode(AbstractCompiler compiler, java.lang.String code)
private void reportCodeChange(java.lang.String changeDescription)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS tree