From a219c3f9c3d1f1038379741be8f012858da212fa Mon Sep 17 00:00:00 2001 From: lucasfcosta Date: Mon, 6 Jun 2016 14:40:00 -0300 Subject: [PATCH] fix: tests for anonymous functions on IE --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 70f5661..603ef50 100644 --- a/index.js +++ b/index.js @@ -132,7 +132,8 @@ function getConstructorName(errorLike) { // If `err` is not an instance of Error it is an error constructor itself or another function. // If we've got a common function we get its name, otherwise we may need to create a new instance // of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more. - constructorName = getFunctionName(errorLike) || getFunctionName(new errorLike()); // eslint-disable-line new-cap + constructorName = getFunctionName(errorLike).trim() || + getFunctionName(new errorLike()); // eslint-disable-line new-cap } return constructorName;