Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

remove .bind() calls. re #680

TJ Holowaychuk9323e89c047e
diff --git a/lib/runner.js b/lib/runner.js
index 854985a3..d79809bb 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -490,7 +490,9 @@ Runner.prototype.run = function(fn){
// callback
this.on('end', function(){
debug('end');
- process.removeListener('uncaughtException', self.uncaught.bind(self));
+ process.removeListener('uncaughtException', function(err){
+ self.uncaught(err);
+ });
fn(self.failures);
});
@@ -502,7 +504,9 @@ Runner.prototype.run = function(fn){
});
// uncaught exception
- process.on('uncaughtException', this.uncaught.bind(this));
+ process.on('uncaughtException', function(err){
+ self.uncaught(err);
+ });
return this;
};