code: private boolean declaresFunctionOrClass(Node n) {
      if (n.isFunction() || n.isClass()) {
        return true;
      }
  
      if (n.isAssign() && (n.getLastChild().isFunction() || n.getLastChild().isClass())) {
        return true;
      }
  
      if (NodeUtil.isNameDeclaration(n)
          && n.getFirstChild().hasChildren()
          && (n.getFirstFirstChild().isFunction() || n.getFirstFirstChild().isClass())) {
        return true;
      }
  
      return false;
    }
docs: If this returns true, check for @extends and @implements annotations on this node. Otherwise,
  it's probably an alias for an existing class, so skip those annotations.
  
  @return Whether the given node declares a function. True for the following forms:
  <li>
  <pre>function foo() {}</pre>
  <li>
  <pre>var foo = function() {};</pre>
  <li>
  <pre>foo.bar = function() {};</pre>