src/Reflection.js
function() {
        var FN_ARGS        = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
            FN_ARG_SPLIT   = /,/,
            FN_ARG         = /^\s*(_?)(\S+?)\1\s*$/,
            STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
            getParams      = function(fn) {
                var fnText, argDecl;
                var args = [];
                fnText = fn.toString().replace(STRIP_COMMENTS, '');
                argDecl = fnText.match(FN_ARGS);

                var r = argDecl[1].split(FN_ARG_SPLIT), repl = function(all, underscore, name) {
                    args.push(name);
                };
                for (var a in r) {
                    var arg = r[a];
                    arg.replace(FN_ARG, repl);
                }

                return args;
            };

        var prototype = this.reflector.getProto();
        var overloads = prototype.__joii__.metadata[this.name].overloads;

        if (!overloads || overloads.length === 0) {
            // old method for BC (wasn't recognized as a function when prototyping)
            return getParams(this.reflector.getProto()[this.name]);
        } else if (overloads.length === 1 && overloads[0].parameters.length === 0) {
            // old method for BC (was recognized when prototyping, but old style)
            return getParams(overloads[0].fn);
        }
        else {
            var ret = [];

            for (var idx = 0; idx < overloads.length; idx++) {
                var fn_meta = [];
                var function_parameters_meta = overloads[idx];
                var parsed_params = getParams(function_parameters_meta.fn);
                for (var j = 0; j < function_parameters_meta.parameters.length; j++) {
                    var param = {
                        name: parsed_params.length > j ? parsed_params[j] : null,
                        type: function_parameters_meta.parameters[j]
                    };
                    fn_meta.push(param);
                }
                ret.push(fn_meta);
            }
            return ret;
        }
    }
function() {
        var FN_ARGS        = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
            FN_ARG_SPLIT   = /,/,
            FN_ARG         = /^\s*(_?)(\S+?)\1\s*$/,
            STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
            getParams      = function(fn) {
                var fnText, argDecl;
                var args = [];
                fnText = fn.toString().replace(STRIP_COMMENTS, '');
                argDecl = fnText.match(FN_ARGS);

                var r = argDecl[1].split(FN_ARG_SPLIT), repl = function(all, underscore, name) {
                    args.push(name);
                };
                for (var a in r) {
                    var arg = r[a];
                    arg.replace(FN_ARG, repl);
                }

                return args;
            };

        var prototype = this.reflector.getProto();
        var overloads = prototype.__joii__.metadata[this.name].overloads;

        if (!overloads || overloads.length === 0) {
            // old method for BC (wasn't recognized as a function when prototyping)
            return getParams(this.reflector.getProto()[this.name]);
        } else if (overloads.length === 1 && overloads[0].parameters.length === 0) {
            // old method for BC (was recognized when prototyping, but old style)
            return getParams(overloads[0].fn);
        }
        else {
            var ret = [];

            for (var idx = 0; idx < overloads.length; idx++) {
                var fn_meta = [];
                var function_parameters_meta = overloads[idx];
                var parsed_params = getParams(function_parameters_meta.fn);
                for (var j = 0; j < function_parameters_meta.parameters.length; j++) {
                    var param = {
                        name: parsed_params.length > j ? parsed_params[j] : null,
                        type: function_parameters_meta.parameters[j]
                    };
                    fn_meta.push(param);
                }
                ret.push(fn_meta);
            }
            return ret;
        }
    }
function ( ) { var FN_ARGS = / ^function\s*[^\(]*\(\s*([^\)]*)\) / m , FN_ARG_SPLIT = / , / , FN_ARG = / ^\s*(_?)(\S+?)\1\s*$ / , STRIP_COMMENTS = / ((\/\/.*$)|(\/\*[\s\S]*?\*\/)) / mg , getParams = function ( fn ) { var fnText , argDecl ; var args = [ ] ; fnText = fn . toString ( ) . replace ( STRIP_COMMENTS , '' ) ; argDecl = fnText . match ( FN_ARGS ) ; var r = argDecl [ 1 ] . split ( FN_ARG_SPLIT ) , repl = function ( all , underscore , name ) { args . push ( name ) ; } ; for ( var a in r ) { var arg = r [ a ] ; arg . replace ( FN_ARG , repl ) ; } return args ; } ; var prototype = this . reflector . getProto ( ) ; var overloads = prototype . __joii__ . metadata [ this . name ] . overloads ; if ( ! overloads || overloads . length === 0 ) { // old method for BC (wasn't recognized as a function when prototyping) return getParams ( this . reflector . getProto ( ) [ this . name ] ) ; } else if ( overloads . length === 1 && overloads [ 0 ] . parameters . length === 0 ) { // old method for BC (was recognized when prototyping, but old style) return getParams ( overloads [ 0 ] . fn ) ; } else { var ret = [ ] ; for ( var idx = 0 ; idx < overloads . length ; idx ++ ) { var fn_meta = [ ] ; var function_parameters_meta = overloads [ idx ] ; var parsed_params = getParams ( function_parameters_meta . fn ) ; for ( var j = 0 ; j < function_parameters_meta . parameters . length ; j ++ ) { var param = { name : parsed_params . length > j ? parsed_params [ j ] : null , type : function_parameters_meta . parameters [ j ] } ; fn_meta . push ( param ) ; } ret . push ( fn_meta ) ; } return ret ; } }
Returns an array of strings based on the parameters defined in
the declared function.

@return string[]
Returns an array of strings based on the parameters defined in the declared function .