diff --git a/lib/buffer.js b/lib/buffer.js index 01a8f303e1..b138552ef9 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -185,7 +185,7 @@ function fromString(string, encoding) { function fromArrayLike(obj) { const length = obj.length; const b = allocate(length); - for (let i = 0; i < length; i++) + for (var i = 0; i < length; i++) b[i] = obj[i] & 255; return b; } @@ -276,6 +276,7 @@ Buffer.isEncoding = function(encoding) { Buffer.concat = function(list, length) { + var i; if (!Array.isArray(list)) throw new TypeError('"list" argument must be an Array of Buffers'); @@ -284,7 +285,7 @@ Buffer.concat = function(list, length) { if (length === undefined) { length = 0; - for (let i = 0; i < list.length; i++) + for (i = 0; i < list.length; i++) length += list[i].length; } else { length = length >>> 0; @@ -292,7 +293,7 @@ Buffer.concat = function(list, length) { var buffer = Buffer.allocUnsafe(length); var pos = 0; - for (let i = 0; i < list.length; i++) { + for (i = 0; i < list.length; i++) { var buf = list[i]; if (!Buffer.isBuffer(buf)) throw new TypeError('"list" argument must be an Array of Buffers');