Repository navigation
Commit de4d49d
committed
stream: narrow pipeTo guard to writer release check
The shuttingDown guard added by the previous commit is too broad: it
also skips an already-read chunk while the destination is still
writable. The WHATWG Streams spec requires pipeTo to write such chunks
during shutdown.
Check writer[kState].stream instead. It becomes undefined only after
finalize() releases the writer, which is precisely the assertion case.
Add a regression test that aborts after enqueue() and verifies that the
already-read chunk is written.
Signed-off-by: Qingyu Wang <wangqingyu.c0l1n@bytedance.com>
Assisted-by: Codex1 parent 456484b commit de4d49d
2 files changed
Lines changed: 31 additions & 1 deletion
File tree
- lib/internal/webstreams
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
1763 | | - | |
| 1763 | + | |
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments