/**
* 獲取函數的形參個數
* @param {Function} func [要獲取的函數]
* @return {*} [形參的數組或undefind]
*/
function getFuncParameters(func) {
if (typeof func == 'function') {
var mathes = /[^(]+\(([^)]*)?\)/gm.exec(Function.prototype.toString.call(func));
if (mathes[1]) {
var args = mathes[1].replace(/[^,\w]*/g, '').split(',');
return args;
}
}
}