diff --git a/lib/buffer.js b/lib/buffer.js index a818f41a26ed5b..991c601072c585 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -544,7 +544,6 @@ Buffer.isEncoding = function isEncoding(encoding) { Buffer[kIsEncodingSymbol] = Buffer.isEncoding; Buffer.concat = function concat(list, length) { - let i; if (!ArrayIsArray(list)) { throw new ERR_INVALID_ARG_TYPE('list', 'Array', list); } @@ -554,7 +553,7 @@ Buffer.concat = function concat(list, length) { if (length === undefined) { length = 0; - for (i = 0; i < list.length; i++) { + for (let i = 0; i < list.length; i++) { if (list[i].length) { length += list[i].length; } @@ -565,7 +564,7 @@ Buffer.concat = function concat(list, length) { const buffer = Buffer.allocUnsafe(length); let pos = 0; - for (i = 0; i < list.length; i++) { + for (let i = 0; i < list.length; i++) { const buf = list[i]; if (!isUint8Array(buf)) { // TODO(BridgeAR): This should not be of type ERR_INVALID_ARG_TYPE.