code: private boolean addParameter(FunctionParamBuilder builder,
        JSType paramType, boolean warnedAboutArgList,
        boolean isOptional, boolean isVarArgs) {
      boolean emittedWarning = false;
      if (isOptional) {
        // Remembering that an optional parameter has been encountered
        // so that if a non optional param is encountered later, an
        // error can be reported.
        if (!builder.addOptionalParams(paramType) && !warnedAboutArgList) {
          reportWarning(VAR_ARGS_MUST_BE_LAST);
          emittedWarning = true;
        }
      } else if (isVarArgs) {
        if (!builder.addVarArgs(paramType) && !warnedAboutArgList) {
          reportWarning(VAR_ARGS_MUST_BE_LAST);
          emittedWarning = true;
        }
      } else {
        if (!builder.addRequiredParams(paramType) && !warnedAboutArgList) {
          // An optional parameter was seen and this argument is not an optional
          // or var arg so it is an error.
          if (builder.hasVarArgs()) {
            reportWarning(VAR_ARGS_MUST_BE_LAST);
          } else {
            reportWarning(OPTIONAL_ARG_AT_END);
          }
          emittedWarning = true;
        }
      }
      return emittedWarning;
    }
docs: Add a parameter to the param list.
  @param builder A builder.
  @param paramType The parameter type.
  @param warnedAboutArgList Whether we've already warned about arg ordering
  issues (like if optional args appeared before required ones).
  @param isOptional Is this an optional parameter?
  @param isVarArgs Is this a var args parameter?
  @return Whether a warning was emitted.