/*!
 * Chai - getName utility
 * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
 * MIT Licensed
 */

/**
 * # getName(func)
 *
 * Gets the name of a function, in a cross-browser way.
 *
 * @param {Function} a function (usually a constructor)
 * @namespace Utils
 * @name getName
 */

module.exports = function (func) {
  if (func.name) return func.name;

  var match = /^\s?function ([^(]*)\(/.exec(func);
  return match && match[1] ? match[1] : "";
};

@@ -294,172 +294,395 @@
 */%0A%0A
-module.exports = function (func) %7B%0A  if (func.name) return func.name;%0A%0A  var match = /%5E%5Cs?function (%5B%5E(%5D*)%5C(/.exec(func);%0A  return match && match%5B1%5D ? match%5B1%5D : %22%22
+var functionNameMatch = /%5Cs*function(?:%5Cs%7C%5Cs*%5C/%5C*%5B%5E(?:*%5C/)%5D+%5C*%5C/%5Cs*)*(%5B%5E%5C(%5C/%5D+)/;%0A%0Amodule.exports = function (func) %7B%0A  var name = '';%0A  if (typeof func.name === 'undefined') %7B%0A    // Here we run a polyfill if func.name is not defined%0A    var match = String(func).match(functionNameMatch);%0A    if (match) %7B%0A      name = match%5B1%5D;%0A    %7D%0A  %7D else %7B%0A    name = func.name;%0A  %7D%0A%0A  return name
 ;%0A%7D;

Update getName to fix inspect in Firefox