code: private void flattenReferencesToCollapsibleDescendantNames(
        Name n, String alias) {
      if (n.props == null || n.isCollapsingExplicitlyDenied()) {
        return;
      }
  
      for (Name p : n.props) {
        String propAlias = appendPropForAlias(alias, p.getBaseName());
  
        boolean isAllowedToCollapse =
            propertyCollapseLevel != PropertyCollapseLevel.MODULE_EXPORT || p.isModuleExport();
  
        if (isAllowedToCollapse && p.canCollapse()) {
          flattenReferencesTo(p, propAlias);
        } else if (isAllowedToCollapse
            && p.isSimpleStubDeclaration()
            && !p.isCollapsingExplicitlyDenied()) {
          flattenSimpleStubDeclaration(p, propAlias);
        }
  
        flattenReferencesToCollapsibleDescendantNames(p, propAlias);
      }
    }
docs: Flattens all references to collapsible properties of a global name except
  their initial definitions. Recurs on subnames.
  
  @param n An object representing a global name
  @param alias The flattened name for {@code n}