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 ; }
Add a parameter to the param list .