Skip to content

Commit d257b86

Browse files
committed
Merge pull request #6 from lucasfcosta/fix-anonymous-functions-ie
fix: tests for anonymous functions on IE
2 parents b87bd62 + a219c3f commit d257b86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ function getConstructorName(errorLike) {
132132
// If `err` is not an instance of Error it is an error constructor itself or another function.
133133
// If we've got a common function we get its name, otherwise we may need to create a new instance
134134
// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more.
135-
constructorName = getFunctionName(errorLike) || getFunctionName(new errorLike()); // eslint-disable-line new-cap
135+
constructorName = getFunctionName(errorLike).trim() ||
136+
getFunctionName(new errorLike()); // eslint-disable-line new-cap
136137
}
137138

138139
return constructorName;

0 commit comments

Comments
 (0)