Code cleanup/removing redundancy in GlobalNamespace.java.
@@ -226,7 +226,7 @@ class GlobalNamespace
* Builds the namespace lazily.
*/
private void process() {
- if (externsRoot != null) {
+ if (hasExternsRoot()) {
inExterns = true;
NodeTraversal.traverseEs6(compiler, externsRoot, new BuildGlobalNamespace());
}
@@ -286,7 +286,7 @@ class GlobalNamespace
public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
// If we are traversing the externs, then we save a pointer to the scope
// generated by them, so that we can do lookups in it later.
- if (externsRoot != null && n == externsRoot) {
+ if (hasExternsRoot() && n == externsRoot) {
externsScope = t.getScope();
}
