function argumentNames(fn){ var found = /^[\s\(]*function[^(]*\(\s*([^)]*?)\s*\)/.exec(fn.toString()); return found && found[1] ? found[1].split(/,\s*/) : []; }