mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib: improved forEach object performance
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
1 parent
86bb7fa5cd
commit
176f0bd3df
6 files changed
+52
-30
No files matched your search
+4
-2
@@ -44,9 +44,11 @@ function Console(stdout, stderr) {
|
||||
Object.defineProperty(this, '_times', prop);
|
||||
|
||||
// bind the prototype functions to this Console instance
|
||||
Object.keys(Console.prototype).forEach(function(k) {
|
||||
var keys = Object.keys(Console.prototype);
|
||||
for (var v = 0; v < keys.length; v++) {
|
||||
var k = keys[v];
|
||||
this[k] = this[k].bind(this);
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
Console.prototype.log = function() {
|
||||
|
||||
Reference in new issue
Block a user