Search in sources :

Example 1 with PropagateConstantAnnotationsOverVars

use of com.google.javascript.jscomp.Normalize.PropagateConstantAnnotationsOverVars in project closure-compiler by google.

the class CollapseProperties method process.

@Override
public void process(Node externs, Node root) {
    GlobalNamespace namespace = new GlobalNamespace(compiler, root);
    nameMap = namespace.getNameIndex();
    globalNames = namespace.getNameForest();
    checkNamespaces();
    for (Name name : globalNames) {
        flattenReferencesToCollapsibleDescendantNames(name, name.getBaseName());
    }
    // invalidating the node ancestry stored with each reference.
    for (Name name : globalNames) {
        collapseDeclarationOfNameAndDescendants(name, name.getBaseName());
    }
    // This shouldn't be necessary, this pass should already be setting new constants as constant.
    // TODO(b/64256754): Investigate.
    (new PropagateConstantAnnotationsOverVars(compiler, false)).process(externs, root);
}
Also used : PropagateConstantAnnotationsOverVars(com.google.javascript.jscomp.Normalize.PropagateConstantAnnotationsOverVars) Name(com.google.javascript.jscomp.GlobalNamespace.Name)

Aggregations

Name (com.google.javascript.jscomp.GlobalNamespace.Name)1 PropagateConstantAnnotationsOverVars (com.google.javascript.jscomp.Normalize.PropagateConstantAnnotationsOverVars)1