Skip to content

Commit 6ee800f

Browse files
committedSep 28, 2020
buffer: also alias BigUInt methods
These were overlooked in 5864fca because of the extra `Big` in the name. :) Refs: #34729 PR-URL: #34960 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 139442c commit 6ee800f

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed
 

‎doc/api/buffer.md

+16
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,10 @@ values.
13751375
### `buf.readBigUInt64BE([offset])`
13761376
<!-- YAML
13771377
added: v12.0.0
1378+
changes:
1379+
- version: REPLACEME
1380+
pr-url: https://github.com/nodejs/node/pull/34960
1381+
description: This function is also available as `buf.readBigUint64BE()`.
13781382
-->
13791383

13801384
* `offset` {integer} Number of bytes to skip before starting to read. Must
@@ -1396,6 +1400,10 @@ console.log(buf.readBigUInt64BE(0));
13961400
added:
13971401
- v12.0.0
13981402
- v10.20.0
1403+
changes:
1404+
- version: REPLACEME
1405+
pr-url: https://github.com/nodejs/node/pull/34960
1406+
description: This function is also available as `buf.readBigUint64LE()`.
13991407
-->
14001408

14011409
* `offset` {integer} Number of bytes to skip before starting to read. Must
@@ -2298,6 +2306,10 @@ console.log(buf);
22982306
added:
22992307
- v12.0.0
23002308
- v10.20.0
2309+
changes:
2310+
- version: REPLACEME
2311+
pr-url: https://github.com/nodejs/node/pull/34960
2312+
description: This function is also available as `buf.writeBigUint64BE()`.
23012313
-->
23022314

23032315
* `value` {bigint} Number to be written to `buf`.
@@ -2319,6 +2331,10 @@ console.log(buf);
23192331
### `buf.writeBigUInt64LE(value[, offset])`
23202332
<!-- YAML
23212333
added: v12.0.0
2334+
changes:
2335+
- version: REPLACEME
2336+
pr-url: https://github.com/nodejs/node/pull/34960
2337+
description: This function is also available as `buf.writeBigUint64LE()`.
23222338
-->
23232339

23242340
* `value` {bigint} Number to be written to `buf`.

‎lib/internal/buffer.js

+4
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,14 @@ class FastBuffer extends Uint8Array {}
951951
function addBufferPrototypeMethods(proto) {
952952
proto.readBigUInt64LE = readBigUInt64LE,
953953
proto.readBigUInt64BE = readBigUInt64BE,
954+
proto.readBigUint64LE = readBigUInt64LE,
955+
proto.readBigUint64BE = readBigUInt64BE,
954956
proto.readBigInt64LE = readBigInt64LE,
955957
proto.readBigInt64BE = readBigInt64BE,
956958
proto.writeBigUInt64LE = writeBigUInt64LE,
957959
proto.writeBigUInt64BE = writeBigUInt64BE,
960+
proto.writeBigUint64LE = writeBigUInt64LE,
961+
proto.writeBigUint64BE = writeBigUInt64BE,
958962
proto.writeBigInt64LE = writeBigInt64LE,
959963
proto.writeBigInt64BE = writeBigInt64BE,
960964

‎test/parallel/test-buffer-writeuint.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ const assert = require('assert');
222222
}
223223

224224
for (const fn of [
225-
'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE'
225+
'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE',
226+
'BigUInt64LE', 'BigUInt64BE',
226227
]) {
227228
const p = Buffer.prototype;
228229
const lowerFn = fn.replace(/UInt/, 'Uint');

0 commit comments

Comments
 (0)
Please sign in to comment.