@@ -1217,7 +1217,7 @@ Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (
12171217 this [ ++ offset ] * 2 ** 16 +
12181218 last * 2 ** 24
12191219
1220- return BigInt ( lo ) + ( BigInt ( hi ) << 32n )
1220+ return BigInt ( lo ) + ( BigInt ( hi ) << BigInt ( 32 ) )
12211221} )
12221222
12231223Buffer . prototype . readBigUInt64BE = defineBigIntMethod ( function readBigUInt64BE ( offset ) {
@@ -1239,7 +1239,7 @@ Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (
12391239 this [ ++ offset ] * 2 ** 8 +
12401240 last
12411241
1242- return ( BigInt ( hi ) << 32n ) + BigInt ( lo )
1242+ return ( BigInt ( hi ) << BigInt ( 32 ) ) + BigInt ( lo )
12431243} )
12441244
12451245Buffer . prototype . readIntLE = function readIntLE ( offset , byteLength , noAssert ) {
@@ -1333,7 +1333,7 @@ Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (of
13331333 this [ offset + 6 ] * 2 ** 16 +
13341334 ( last << 24 ) // Overflow
13351335
1336- return ( BigInt ( val ) << 32n ) +
1336+ return ( BigInt ( val ) << BigInt ( 32 ) ) +
13371337 BigInt ( first +
13381338 this [ ++ offset ] * 2 ** 8 +
13391339 this [ ++ offset ] * 2 ** 16 +
@@ -1354,7 +1354,7 @@ Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (of
13541354 this [ ++ offset ] * 2 ** 8 +
13551355 this [ ++ offset ]
13561356
1357- return ( BigInt ( val ) << 32n ) +
1357+ return ( BigInt ( val ) << BigInt ( 32 ) ) +
13581358 BigInt ( this [ ++ offset ] * 2 ** 24 +
13591359 this [ ++ offset ] * 2 ** 16 +
13601360 this [ ++ offset ] * 2 ** 8 +
@@ -1487,15 +1487,15 @@ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert
14871487function wrtBigUInt64LE ( buf , value , offset , min , max ) {
14881488 checkIntBI ( value , min , max , buf , offset , 7 )
14891489
1490- let lo = Number ( value & 0xffffffffn )
1490+ let lo = Number ( value & BigInt ( 0xffffffff ) )
14911491 buf [ offset ++ ] = lo
14921492 lo = lo >> 8
14931493 buf [ offset ++ ] = lo
14941494 lo = lo >> 8
14951495 buf [ offset ++ ] = lo
14961496 lo = lo >> 8
14971497 buf [ offset ++ ] = lo
1498- let hi = Number ( value >> 32n & 0xffffffffn )
1498+ let hi = Number ( value >> BigInt ( 32 ) & BigInt ( 0xffffffff ) )
14991499 buf [ offset ++ ] = hi
15001500 hi = hi >> 8
15011501 buf [ offset ++ ] = hi
@@ -1509,15 +1509,15 @@ function wrtBigUInt64LE (buf, value, offset, min, max) {
15091509function wrtBigUInt64BE ( buf , value , offset , min , max ) {
15101510 checkIntBI ( value , min , max , buf , offset , 7 )
15111511
1512- let lo = Number ( value & 0xffffffffn )
1512+ let lo = Number ( value & BigInt ( 0xffffffff ) )
15131513 buf [ offset + 7 ] = lo
15141514 lo = lo >> 8
15151515 buf [ offset + 6 ] = lo
15161516 lo = lo >> 8
15171517 buf [ offset + 5 ] = lo
15181518 lo = lo >> 8
15191519 buf [ offset + 4 ] = lo
1520- let hi = Number ( value >> 32n & 0xffffffffn )
1520+ let hi = Number ( value >> BigInt ( 32 ) & BigInt ( 0xffffffff ) )
15211521 buf [ offset + 3 ] = hi
15221522 hi = hi >> 8
15231523 buf [ offset + 2 ] = hi
@@ -1529,11 +1529,11 @@ function wrtBigUInt64BE (buf, value, offset, min, max) {
15291529}
15301530
15311531Buffer . prototype . writeBigUInt64LE = defineBigIntMethod ( function writeBigUInt64LE ( value , offset = 0 ) {
1532- return wrtBigUInt64LE ( this , value , offset , 0n , 0xffffffffffffffffn )
1532+ return wrtBigUInt64LE ( this , value , offset , BigInt ( 0 ) , BigInt ( '0xffffffffffffffff' ) )
15331533} )
15341534
15351535Buffer . prototype . writeBigUInt64BE = defineBigIntMethod ( function writeBigUInt64BE ( value , offset = 0 ) {
1536- return wrtBigUInt64BE ( this , value , offset , 0n , 0xffffffffffffffffn )
1536+ return wrtBigUInt64BE ( this , value , offset , BigInt ( 0 ) , BigInt ( '0xffffffffffffffff' ) )
15371537} )
15381538
15391539Buffer . prototype . writeIntLE = function writeIntLE ( value , offset , byteLength , noAssert ) {
@@ -1633,11 +1633,11 @@ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert)
16331633}
16341634
16351635Buffer . prototype . writeBigInt64LE = defineBigIntMethod ( function writeBigInt64LE ( value , offset = 0 ) {
1636- return wrtBigUInt64LE ( this , value , offset , - 0x8000000000000000n , 0x7fffffffffffffffn )
1636+ return wrtBigUInt64LE ( this , value , offset , - BigInt ( '0x8000000000000000' ) , BigInt ( '0x7fffffffffffffff' ) )
16371637} )
16381638
16391639Buffer . prototype . writeBigInt64BE = defineBigIntMethod ( function writeBigInt64BE ( value , offset = 0 ) {
1640- return wrtBigUInt64BE ( this , value , offset , - 0x8000000000000000n , 0x7fffffffffffffffn )
1640+ return wrtBigUInt64BE ( this , value , offset , - BigInt ( '0x8000000000000000' ) , BigInt ( '0x7fffffffffffffff' ) )
16411641} )
16421642
16431643function checkIEEE754 ( buf , value , offset , ext , max , min ) {
@@ -1858,7 +1858,7 @@ E('ERR_OUT_OF_RANGE',
18581858 received = addNumericalSeparator ( String ( input ) )
18591859 } else if ( typeof input === 'bigint' ) {
18601860 received = String ( input )
1861- if ( input > 2n ** 32n || input < - ( 2n ** 32n ) ) {
1861+ if ( input > BigInt ( 2 ) ** BigInt ( 32 ) || input < - ( BigInt ( 2 ) ** BigInt ( 32 ) ) ) {
18621862 received = addNumericalSeparator ( received )
18631863 }
18641864 received += 'n'
@@ -1892,7 +1892,7 @@ function checkIntBI (value, min, max, buf, offset, byteLength) {
18921892 const n = typeof min === 'bigint' ? 'n' : ''
18931893 let range
18941894 if ( byteLength > 3 ) {
1895- if ( min === 0 || min === 0n ) {
1895+ if ( min === 0 || min === BigInt ( 0 ) ) {
18961896 range = `>= 0${ n } and < 2${ n } ** ${ ( byteLength + 1 ) * 8 } ${ n } `
18971897 } else {
18981898 range = `>= -(2${ n } ** ${ ( byteLength + 1 ) * 8 - 1 } ${ n } ) and < 2 ** ` +
0 commit comments