(func)
| 8377 | var regex = /\s*function\s+([^\(\s]*)\s*/; |
| 8378 | // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js |
| 8379 | function getName(func) { |
| 8380 | if (!util.isFunction(func)) { |
| 8381 | return; |
| 8382 | } |
| 8383 | if (functionsHaveNames) { |
| 8384 | return func.name; |
| 8385 | } |
| 8386 | var str = func.toString(); |
| 8387 | var match = str.match(regex); |
| 8388 | return match && match[1]; |
| 8389 | } |
| 8390 | assert.AssertionError = function AssertionError(options) { |
| 8391 | this.name = 'AssertionError'; |
| 8392 | this.actual = options.actual; |
no test coverage detected