@@ -317,7 +317,7 @@ Buffer.from = function from(value, encodingOrOffset, length) {
317
317
// Refs: https://esdiscuss.org/topic/isconstructor#content-11
318
318
const of = ( ...items ) => {
319
319
const newObj = createUnsafeBuffer ( items . length ) ;
320
- for ( var k = 0 ; k < items . length ; k ++ )
320
+ for ( let k = 0 ; k < items . length ; k ++ )
321
321
newObj [ k ] = items [ k ] ;
322
322
return newObj ;
323
323
} ;
@@ -433,7 +433,7 @@ function fromString(string, encoding) {
433
433
function fromArrayLike ( obj ) {
434
434
const length = obj . length ;
435
435
const b = allocate ( length ) ;
436
- for ( var i = 0 ; i < length ; i ++ )
436
+ for ( let i = 0 ; i < length ; i ++ )
437
437
b [ i ] = obj [ i ] ;
438
438
return b ;
439
439
}
@@ -1044,7 +1044,7 @@ Buffer.prototype.write = function write(string, offset, length, encoding) {
1044
1044
Buffer . prototype . toJSON = function toJSON ( ) {
1045
1045
if ( this . length > 0 ) {
1046
1046
const data = new Array ( this . length ) ;
1047
- for ( var i = 0 ; i < this . length ; ++ i )
1047
+ for ( let i = 0 ; i < this . length ; ++ i )
1048
1048
data [ i ] = this [ i ] ;
1049
1049
return { type : 'Buffer' , data } ;
1050
1050
}
@@ -1090,7 +1090,7 @@ Buffer.prototype.swap16 = function swap16() {
1090
1090
if ( len % 2 !== 0 )
1091
1091
throw new ERR_INVALID_BUFFER_SIZE ( '16-bits' ) ;
1092
1092
if ( len < 128 ) {
1093
- for ( var i = 0 ; i < len ; i += 2 )
1093
+ for ( let i = 0 ; i < len ; i += 2 )
1094
1094
swap ( this , i , i + 1 ) ;
1095
1095
return this ;
1096
1096
}
@@ -1105,7 +1105,7 @@ Buffer.prototype.swap32 = function swap32() {
1105
1105
if ( len % 4 !== 0 )
1106
1106
throw new ERR_INVALID_BUFFER_SIZE ( '32-bits' ) ;
1107
1107
if ( len < 192 ) {
1108
- for ( var i = 0 ; i < len ; i += 4 ) {
1108
+ for ( let i = 0 ; i < len ; i += 4 ) {
1109
1109
swap ( this , i , i + 3 ) ;
1110
1110
swap ( this , i + 1 , i + 2 ) ;
1111
1111
}
@@ -1122,7 +1122,7 @@ Buffer.prototype.swap64 = function swap64() {
1122
1122
if ( len % 8 !== 0 )
1123
1123
throw new ERR_INVALID_BUFFER_SIZE ( '64-bits' ) ;
1124
1124
if ( len < 192 ) {
1125
- for ( var i = 0 ; i < len ; i += 8 ) {
1125
+ for ( let i = 0 ; i < len ; i += 8 ) {
1126
1126
swap ( this , i , i + 7 ) ;
1127
1127
swap ( this , i + 1 , i + 6 ) ;
1128
1128
swap ( this , i + 2 , i + 5 ) ;
0 commit comments