☕️ Classic, reliable, trusted test framework for Node.js and the browser
Use Mocha.utils.forEach (fix #1082)
Travis Jefferyca4bc3604fa8
diff --git a/mocha.js b/mocha.jsindex 43acbcce..9b54d25e 100644--- a/mocha.js+++ b/mocha.js@@ -5670,8 +5670,8 @@ Mocha.Runner.immediately = function(callback) {* only receive the 'message' attribute of the Error.*/mocha.throwError = function(err) {- uncaughtExceptionHandlers.forEach(function (fn) {- fn(err) ;+ Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {+ fn(err);});throw err;};diff --git a/support/tail.js b/support/tail.jsindex 7f757e8b..018add8d 100644--- a/support/tail.js+++ b/support/tail.js@@ -96,8 +96,8 @@ Mocha.Runner.immediately = function(callback) {* only receive the 'message' attribute of the Error.*/mocha.throwError = function(err) {- uncaughtExceptionHandlers.forEach(function (fn) {- fn(err) ;+ Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {+ fn(err);});throw err;};