code: static Visibility getEffectiveNameVisibility(Node name, Var var,
        ImmutableMap<StaticSourceFile, Visibility> fileVisibilityMap) {
      JSDocInfo jsDocInfo = var.getJSDocInfo();
      Visibility raw = (jsDocInfo == null || jsDocInfo.getVisibility() == null)
          ? Visibility.INHERITED
          : jsDocInfo.getVisibility();
      if (raw != Visibility.INHERITED) {
        return raw;
      }
      Visibility defaultVisibilityForFile =
          fileVisibilityMap.get(var.getSourceFile());
      JSType type = name.getJSType();
      boolean createdFromGoogProvide = (type != null && type.isLiteralObject());
      // Ignore @fileoverview visibility when computing the effective visibility
      // for names created by goog.provide.
      //
      // ProcessClosurePrimitives rewrites goog.provide()s as object literal
      // declarations, but the exact form depends on the ordering of the
      // input files. If goog.provide('a.b') occurs in the inputs before
      // goog.provide('a'), it is rewritten like
      //
      // var a={};a.b={};
      //
      // If the file containing goog.provide('a.b') also declares a @fileoverview
      // visibility, it must not apply to a, as this would make every a.* namespace
      // effectively package-private.
      return (createdFromGoogProvide || defaultVisibilityForFile == null)
          ? raw
          : defaultVisibilityForFile;
    }
docs: Returns the effective visibility of the given name. This can differ
  from the name's declared visibility if the file's {@code @fileoverview}
  JsDoc specifies a default visibility.
  
  @param name The name node to compute effective visibility for.
  @param var The name to compute effective visibility for.
  @param fileVisibilityMap A map of {@code @fileoverview} visibility
  annotations, used to compute the name's default visibility.