Commit f2ada96
committed
stream: prevent unhandled rejection in Broadcast.from() pump
`Broadcast.from()` used a fire-and-forget async IIFE to pump data
from source to writer. While the catch block routes all errors
to `writer.fail()` which never rejects, the IIFE's promise was
unguarded against future invariant changes.
Extract the IIFE to a named pump function and attach a no-op
rejection handler via `PromisePrototypeThen`.1 parent 9b21cbd commit f2ada96
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
682 | | - | |
| 683 | + | |
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
| |||
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
724 | | - | |
| 725 | + | |
| 726 | + | |
725 | 727 | | |
726 | 728 | | |
727 | 729 | | |
| |||
0 commit comments