@@ -317,7 +317,7 @@ Buffer.from = function from(value, encodingOrOffset, length) {
317317// Refs: https://esdiscuss.org/topic/isconstructor#content-11
318318const of = ( ...items ) => {
319319 const newObj = createUnsafeBuffer ( items . length ) ;
320- for ( var k = 0 ; k < items . length ; k ++ )
320+ for ( let k = 0 ; k < items . length ; k ++ )
321321 newObj [ k ] = items [ k ] ;
322322 return newObj ;
323323} ;
@@ -433,7 +433,7 @@ function fromString(string, encoding) {
433433function fromArrayLike ( obj ) {
434434 const length = obj . length ;
435435 const b = allocate ( length ) ;
436- for ( var i = 0 ; i < length ; i ++ )
436+ for ( let i = 0 ; i < length ; i ++ )
437437 b [ i ] = obj [ i ] ;
438438 return b ;
439439}
@@ -1044,7 +1044,7 @@ Buffer.prototype.write = function write(string, offset, length, encoding) {
10441044Buffer . prototype . toJSON = function toJSON ( ) {
10451045 if ( this . length > 0 ) {
10461046 const data = new Array ( this . length ) ;
1047- for ( var i = 0 ; i < this . length ; ++ i )
1047+ for ( let i = 0 ; i < this . length ; ++ i )
10481048 data [ i ] = this [ i ] ;
10491049 return { type : 'Buffer' , data } ;
10501050 }
@@ -1090,7 +1090,7 @@ Buffer.prototype.swap16 = function swap16() {
10901090 if ( len % 2 !== 0 )
10911091 throw new ERR_INVALID_BUFFER_SIZE ( '16-bits' ) ;
10921092 if ( len < 128 ) {
1093- for ( var i = 0 ; i < len ; i += 2 )
1093+ for ( let i = 0 ; i < len ; i += 2 )
10941094 swap ( this , i , i + 1 ) ;
10951095 return this ;
10961096 }
@@ -1105,7 +1105,7 @@ Buffer.prototype.swap32 = function swap32() {
11051105 if ( len % 4 !== 0 )
11061106 throw new ERR_INVALID_BUFFER_SIZE ( '32-bits' ) ;
11071107 if ( len < 192 ) {
1108- for ( var i = 0 ; i < len ; i += 4 ) {
1108+ for ( let i = 0 ; i < len ; i += 4 ) {
11091109 swap ( this , i , i + 3 ) ;
11101110 swap ( this , i + 1 , i + 2 ) ;
11111111 }
@@ -1122,7 +1122,7 @@ Buffer.prototype.swap64 = function swap64() {
11221122 if ( len % 8 !== 0 )
11231123 throw new ERR_INVALID_BUFFER_SIZE ( '64-bits' ) ;
11241124 if ( len < 192 ) {
1125- for ( var i = 0 ; i < len ; i += 8 ) {
1125+ for ( let i = 0 ; i < len ; i += 8 ) {
11261126 swap ( this , i , i + 7 ) ;
11271127 swap ( this , i + 1 , i + 6 ) ;
11281128 swap ( this , i + 2 , i + 5 ) ;
0 commit comments