ReviewOS

zig-utils/zig-js

ABI: implement private BigInt comparison and arithmetic

#177
Closed chris opened this 9 days ago ·
9 days ago

Parents: #163, #164 Depends on: #170, #174

Implement the shared private BigInt relational and arithmetic boundary.

Acceptance:

  • Export exact JSC__JSValue__asBigIntCompare, JSC__JSValue__bigIntSum, and JSC__JSValue__fromTimevalNoTruncate signatures.
  • Preserve the pinned comparison-result numbering: equal, undefined (NaN), greater-than, and less-than.
  • Compare arbitrary-size BigInts exactly against BigInt and Number inputs, including fractional doubles, infinities, signed zero, and NaN.
  • Add arbitrary-size heap BigInts without narrowing or overflow.
  • Preserve the pinned timeval formula exactly as sec * 1_000_000 + nsec, including signed i64 extremes.
  • Reject invalid and foreign-context inputs safely.
  • Cover exact signatures, comparison boundaries, overflow-sized sums, and timeval extremes in the compile-link-runtime fixture.
  • Update both inventories and README/API documentation without changing public/extension counts.
9 days ago

Implemented and documented on main in aa3828f and 24626fb. Focused evidence: Home 29/432 with 27/27 runtime symbols, Bun core 29/422, and public/extension accounting unchanged at 117/19.

Sign in to comment on this issue.