| 6089 | var regex = /\s*function\s+([^\(\s]*)\s*/; |
| 6090 | // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js |
| 6091 | function getName(func) { |
| 6092 | if (!util.isFunction(func)) { |
| 6093 | return; |
| 6094 | } |
| 6095 | if (functionsHaveNames) { |
| 6096 | return func.name; |
| 6097 | } |
| 6098 | var str = func.toString(); |
| 6099 | var match = str.match(regex); |
| 6100 | return match && match[1]; |
| 6101 | } |
| 6102 | assert.AssertionError = function AssertionError(options) { |
| 6103 | this.name = 'AssertionError'; |
| 6104 | this.actual = options.actual; |