Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Add faster Runner.prototype.globals(arr) (close #1024)

Travis Jeffery8bec097084fb
diff --git a/lib/runner.js b/lib/runner.js
index dffc3c05..6f7e28ca 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -145,9 +145,7 @@ Runner.prototype.globalProps = function() {
Runner.prototype.globals = function(arr){
if (0 == arguments.length) return this._globals;
debug('globals %j', arr);
- utils.forEach(arr, function(arr){
- this._globals.push(arr);
- }, this);
+ this._globals = this._globals.concat(arr);
return this;
};