blob: 2b9d9cc4e646ce63809cece642c2adbad7dea5da [file] [log] [blame]
// shim for Function.prototype.name,
// for browsers that don't support it like IE
/* istanbul ignore next */
function f() {}
var hasName = f.name;
var res;
// We dont run coverage in IE
/* istanbul ignore else */
if (hasName) {
res = function (fun) {
return fun.name;
};
} else {
res = function (fun) {
return fun.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
};
}
export default res;