3 var mixin = require('../../object/mixin')
4 , validFunction = require('../valid-function')
6 , re = /^\s*function\s*([\0-'\)-\uffff]+)*\s*\(([\0-\(\*-\uffff]*)\)\s*\{/;
8 module.exports = function () {
9 var match = String(validFunction(this)).match(re), fn;
11 fn = new Function('fn', 'return function ' + match[1].trim() + '(' +
12 match[2] + ') { return fn.apply(this, arguments); };')(this);
13 try { mixin(fn, this); } catch (ignore) {}