Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Removed a bind() call for Safari

Tj Holowaychuk23b3e1e7b755
diff --git a/lib/runner.js b/lib/runner.js
index caf42d24..5a7f98f1 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -31,10 +31,11 @@ module.exports = Runner;
*/
function Runner(suite) {
+ var self = this;
this.suite = suite;
this.total = suite.total();
this.globals = Object.keys(global).concat(['errno']);
- this.on('test end', this.checkGlobals.bind(this));
+ this.on('test end', function(){ self.checkGlobals(); });
this.grep(/.*/);
}
diff --git a/mocha.js b/mocha.js
index 74fce15f..eab2eed3 100644
--- a/mocha.js
+++ b/mocha.js
@@ -1449,10 +1449,11 @@ module.exports = Runner;
*/
function Runner(suite) {
+ var self = this;
this.suite = suite;
this.total = suite.total();
this.globals = Object.keys(global).concat(['errno']);
- this.on('test end', this.checkGlobals.bind(this));
+ this.on('test end', function(){ self.checkGlobals(); });
this.grep(/.*/);
}