From df2dce08aa6592863eb48101f628cb3a8f5858ce Mon Sep 17 00:00:00 2001 From: Kyriakos Markakis Date: Tue, 12 Nov 2019 15:58:47 +0000 Subject: [PATCH] lib: change var to let in internal/streams PR-URL: https://github.com/nodejs/node/pull/30430 Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: Gireesh Punathil Reviewed-By: Denys Otrishko --- lib/internal/streams/buffer_list.js | 8 ++++---- lib/internal/streams/legacy.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index 715d5d201d4df4..5e23f2cf464f6c 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -48,8 +48,8 @@ module.exports = class BufferList { join(s) { if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; + let p = this.head; + let ret = '' + p.data; while (p = p.next) ret += s + p.data; return ret; @@ -59,8 +59,8 @@ module.exports = class BufferList { if (this.length === 0) return Buffer.alloc(0); const ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; + let p = this.head; + let i = 0; while (p) { ret.set(p.data, i); i += p.data.length; diff --git a/lib/internal/streams/legacy.js b/lib/internal/streams/legacy.js index 06e48e8b15d839..062eabec3890c0 100644 --- a/lib/internal/streams/legacy.js +++ b/lib/internal/streams/legacy.js @@ -36,7 +36,7 @@ Stream.prototype.pipe = function(dest, options) { source.on('close', onclose); } - var didOnEnd = false; + let didOnEnd = false; function onend() { if (didOnEnd) return; didOnEnd = true;