private boolean isJSDocOnFunctionNode ( Node n , JSDocInfo info ) { switch ( n . getToken ( ) ) { case FUNCTION : case GETTER_DEF : case SETTER_DEF : case MEMBER_FUNCTION_DEF : case STRING_KEY : case COMPUTED_PROP : case EXPORT : return true ; case GETELEM : case GETPROP : if ( n . getFirstChild ( ) . isQualifiedName ( ) ) { // assume qualified names may be function declarations return true ; } return false ; case VAR : case LET : case CONST : case ASSIGN : { Node lhs = n . getFirstChild ( ) ; Node rhs = NodeUtil . getRValueOfLValue ( lhs ) ; if ( rhs != null && isClass ( rhs ) && ! info . isConstructor ( ) ) { return false ; } // TODO(b/124081098): Check that the RHS of the assignment is a // function. Note that it can be a FUNCTION node, but it can also be // a call to goog.abstractMethod, goog.functions.constant, etc. return true ; } default : return false ; } }
Whether this node s JSDoc may apply to a function