ReviewOS

home-lang/home

Bun parity: preserve lazy Bun.file slice bounds and composition

#340
Closed chris opened this 10 days ago ·
10 days ago

Upstream gap

After fixing Blob URL module imports in #339, copied corpus position 4112 (js/web/fetch/blob.test.ts) advances to Bun.file().slice: blob.slice(-1, 3) reports size 3 instead of 0.

Required parity

  • Preserve a lazy file reference while applying Web Blob relative/absolute slice bounds.
  • Compute empty, negative, out-of-range, and chained slices consistently with Bun even before file contents are read.
  • Preserve content type and read only the selected byte interval.
  • Use structured file-slice errors with operation/path/range/cause/stack where I/O fails.
  • Add focused regression coverage and pass the complete upstream file plus surrounding queue.

Tracked under #66 and exposed by #339.

10 days ago

Completed in add6ef2.\n\nBun.file slices now preserve lazy path/range references, correctly normalize negative/out-of-range/NaN/Infinity bounds and content-type overloads, compose chained slice ranges, and surface read failures as ERR_BUN_FILE_SLICE with operation/path/start/end/cause/composed stack metadata.\n\nVerified by the focused lazy slice regression and the exact Blob corpus frontier run.

Sign in to comment on this issue.