@Override public void process(Node externs, Node root) { NodeTraversal.traverse(compiler, root, new AddMarkers(compiler)); NodeTraversal.traverse(compiler, root, new AddChecks()); addBoilerplateCode(); new Normalize(compiler, false).process(externs, root); }
@Override public void process(Node externs, Node root) { NodeTraversal.traverseEs6(compiler, root, new AddMarkers(compiler)); NodeTraversal.traverseEs6(compiler, root, new AddChecks()); addBoilerplateCode(); new Normalize(compiler, false).process(externs, root); }
/** * Verifies that the normalization pass does nothing on an already-normalized tree. */ private void checkNormalization(Node externs, Node root) { // Verify nothing has inappropriately denormalize the AST. CodeChangeHandler handler = new ForbiddenChange(); compiler.addChangeHandler(handler); // TODO(johnlenz): Change these normalization checks Preconditions and // Exceptions into Errors so that it is easier to find the root cause // when there are cascading issues. new PrepareAst(compiler, true).process(null, root); if (compiler.getLifeCycleStage().isNormalized()) { (new Normalize(compiler, true)).process(externs, root); if (compiler.getLifeCycleStage().isNormalizedUnobfuscated()) { boolean checkUserDeclarations = true; CompilerPass pass = new Normalize.VerifyConstants(compiler, checkUserDeclarations); pass.process(externs, root); } } compiler.removeChangeHandler(handler); }
/** * Sanity checks the AST. This is by verifying the normalization passes do * nothing. */ private void sanityCheckNormalization(Node externs, Node root) { // Verify nothing has inappropriately denormalize the AST. CodeChangeHandler handler = new ForbiddenChange(); compiler.addChangeHandler(handler); // TODO(johnlenz): Change these normalization checks Preconditions and // Exceptions into Errors so that it is easier to find the root cause // when there are cascading issues. new PrepareAst(compiler, true).process(null, root); if (compiler.getLifeCycleStage().isNormalized()) { (new Normalize(compiler, true)).process(externs, root); if (compiler.getLifeCycleStage().isNormalizedUnobfuscated()) { boolean checkUserDeclarations = true; CompilerPass pass = new Normalize.VerifyConstants( compiler, checkUserDeclarations); pass.process(externs, root); } } compiler.removeChangeHandler(handler); }