code: private SymbolScope createScopeFrom(StaticScope otherScope) {
      Node otherScopeRoot = otherScope.getRootNode();
  
      SymbolScope myScope = scopes.get(otherScopeRoot);
      if (myScope == null) {
        StaticScope otherScopeParent = otherScope.getParentScope();
  
        // If otherScope is a global scope, and we already have a global scope,
        // then something has gone seriously wrong.
        //
        // Not all symbol tables are rooted at the same global node, and
        // we do not want to mix and match symbol tables that are rooted
        // differently.
  
        if (otherScopeParent == null) {
          // The global scope must be created before any local scopes.
          checkState(globalScope == null, "Global scopes found at different roots");
        }
  
        myScope =
            new SymbolScope(
                otherScopeRoot,
                otherScopeParent == null ? null : createScopeFrom(otherScopeParent),
                getTypeOfThis(otherScope),
                null);
        scopes.put(otherScopeRoot, myScope);
        if (myScope.isGlobalScope()) {
          globalScope = myScope;
        }
      }
      return myScope;
    }
docs: Given a scope from another symbol table, returns the {@code SymbolScope} rooted at the same
  node. Creates one if it doesn't exist yet.