nl_tokens: / * ! function - arguments <https : // github . com / tunnckoCore / function - arguments >
pl_tokens: function functionArguments ( fn ) { if ( typeof fn !== 'function' ) { throw new TypeError ( 'function-arguments expect a function' ) } if ( fn . length === 0 ) { return [ ] } // from https://github.com/jrburke/requirejs var reComments = / (\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$) / mg ; var fnToStr = Function . prototype . toString ; var fnStr = fnToStr . call ( fn ) ; fnStr = fnStr . replace ( reComments , '' ) || fnStr ; fnStr = fnStr . slice ( 0 , fnStr . indexOf ( '{' ) ) ; var open = fnStr . indexOf ( '(' ) ; var close = fnStr . indexOf ( ')' ) ; open = open >= 0 ? open + 1 : 0 ; close = close > 0 ? <mask> : fnStr . indexOf ( '=' ) ; fnStr = fnStr . slice ( open , close ) ; fnStr = '(' + fnStr + ')' ; var match = fnStr . match ( / \(([\s\S]*)\) / ) ; return match ? match [ 1 ] . split ( ',' ) . map ( function ( param ) { return param . trim ( ) } ) : [ ] }