Merge branch 'prettyPrintCustomConstructortoString' of https://github.com/mbildner/jasmine into mbildner-prettyPrintCustomConstructortoString

- Fixes #1019
- Merges #1099
This commit is contained in:
Gregg Van Hove
2016-08-15 15:50:21 -07:00
3 changed files with 32 additions and 2 deletions

View File

@@ -38,7 +38,12 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
};
j$.fnNameFor = function(func) {
return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1];
if (func.name) {
return func.name;
}
var matches = func.toString().match(/^\s*function\s*(\w*)\s*\(/);
return matches ? matches[1] : '<anonymous>';
};
j$.any = function(clazz) {