Skip to content

Implement ReadableStream.from - #32533

Closed
robobun wants to merge 6 commits into
mainfrom
farm/74ef6f1c/readable-stream-from
Closed

Implement ReadableStream.from#32533
robobun wants to merge 6 commits into
mainfrom
farm/74ef6f1c/readable-stream-from

streams: implement ReadableStream.from static method

f1171d0
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 20, 2026 in 16m 39s

Code review found 2 potential issues

Found 5 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/builtins/ReadableStream.ts:145-160 Sync-iterator path skips awaiting iterResult.value in pull(done:true) and cancel()

Annotations

Check warning on line 160 in src/js/builtins/ReadableStream.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Sync-iterator path skips awaiting iterResult.value in pull(done:true) and cancel()

The hand-rolled `CreateAsyncFromSyncIterator` emulation skips awaiting `iterResult.value` in two branches: the `pull()` `done:true` branch (just calls `controller.close()`) and the `cancel()` path (returns after the `$isObject` check). Per spec, `AsyncFromSyncIteratorContinuation` always `PromiseResolve`s and awaits `result.value`, so a sync iterator whose `next()`/`return()` yields `{ value: Promise.reject(err), done: true }` should error the stream / reject `cancel()` — here it resolves cleanl