mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: change var to let/const
PR-URL: https://github.com/nodejs/node/pull/30910 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
committed by
Anna Henningsen
parent
31b8f4476f
commit
952b90ca8d
@@ -115,12 +115,11 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
|
||||
|
||||
// Bind the prototype functions to this Console instance
|
||||
const keys = ObjectKeys(Console.prototype);
|
||||
for (var v = 0; v < keys.length; v++) {
|
||||
var k = keys[v];
|
||||
for (const key of keys) {
|
||||
// We have to bind the methods grabbed from the instance instead of from
|
||||
// the prototype so that users extending the Console can override them
|
||||
// from the prototype chain of the subclass.
|
||||
this[k] = this[k].bind(this);
|
||||
this[key] = this[key].bind(this);
|
||||
}
|
||||
|
||||
this[kBindStreamsEager](stdout, stderr);
|
||||
|
||||
Reference in New Issue
Block a user