From cbe29ce4cf10a62d960dbd01208c99a470818eae Mon Sep 17 00:00:00 2001 From: "rene.herrmann" Date: Thu, 12 Dec 2019 10:12:22 +0100 Subject: [PATCH] lib: change var to let/const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30910 Reviewed-By: Ruben Bridgewater Reviewed-By: Michaƫl Zasso Reviewed-By: Gireesh Punathil Reviewed-By: Jiawen Geng Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat --- lib/internal/console/constructor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 5aa3c3a28367d8..d785b7f8dea292 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -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);