src/com/google/javascript/jscomp/CheckJSDoc.java
/**
   * Check that a parameter with a default value is marked as optional.
   * TODO(bradfordcsmith): This is redundant. We shouldn't require it.
   */
Check that a parameter with a default value is marked as optional.
Check that a parameter with a default value is marked as optional .
private void validateDefaultValue(Node n) {
    if (n.isDefaultValue() && n.getParent().isParamList()) {
      Node targetNode = n.getFirstChild();
      JSDocInfo info = targetNode.getJSDocInfo();
      if (info == null) {
        return;
      }
      JSTypeExpression typeExpr = info.getType();
      if (typeExpr == null) {
        return;
      }
      Node typeNode = typeExpr.getRoot();
      if (typeNode.getToken() != Token.EQUALS) {
        report(typeNode, DEFAULT_PARAM_MUST_BE_MARKED_OPTIONAL);
      }
    }
  }
private void validateDefaultValue ( Node n ) { if ( n . isDefaultValue ( ) && n . getParent ( ) . isParamList ( ) ) { Node targetNode = n . getFirstChild ( ) ; JSDocInfo info = targetNode . getJSDocInfo ( ) ; if ( info == null ) { return ; } JSTypeExpression typeExpr = info . getType ( ) ; if ( typeExpr == null ) { return ; } Node typeNode = typeExpr . getRoot ( ) ; if ( typeNode . getToken ( ) != Token . EQUALS ) { report ( typeNode , DEFAULT_PARAM_MUST_BE_MARKED_OPTIONAL ) ; } } }
Check that a parameter with a default value is marked as optional.
Check that a parameter with a default value is marked as optional .