Skip to content

Add missing BigUint64 runtime aliases - #377

Open
saitakarcesme wants to merge 1 commit into
feross:masterfrom
saitakarcesme:codex/biguint64-runtime-aliases
Open

saitakarcesme wants to merge 1 commit into
feross:masterfrom
saitakarcesme:codex/biguint64-runtime-aliases

Conversation

@saitakarcesme

Copy link
Copy Markdown

Fixes #318 and #353.

Expose readBigUint64LE, readBigUint64BE, writeBigUint64LE and writeBigUint64BE as aliases of the existing BigUInt64 methods, matching Node's capitalization aliases. Use the same function objects, including the existing BigInt not supported fallback.

Regression tests verify alias identity, zero/ordinary/maximum unsigned values, default and nonzero offsets, write return offsets, unchanged prefix bytes, and range errors. Eight existence/identity assertions fail on the original source; all 46 assertions pass after the fix.

Validation with Node 24.21.0:

  • Full npm test: 1,048,608 assertions passed.
  • npm run standard -- index.js test/bigint-aliases.js: passed.
  • Additional comparison against native Node Buffer confirms identical bytes and returned values for both endiannesses.
  • VM check with BigInt unavailable confirms all four aliases retain the same fallback function/error.
  • git diff --check: passed.

This PR supplies the missing runtime methods. The corresponding TypeScript declarations are already proposed in open PR #360, so this does not duplicate that contributor's declaration changes. Browser-specific runners were not run locally.

AI disclosure: implemented and tested by OpenAI Codex at the account owner's request. No claim of independent human code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

writeBigUint64BE isn't defined, but writeBigUInt64BE is

1 participant