(stream, reading, writing)
| 49 | let addAbortListener; |
| 50 | |
| 51 | function destroyer(stream, reading, writing) { |
| 52 | let finished = false; |
| 53 | stream.on('close', () => { |
| 54 | finished = true; |
| 55 | }); |
| 56 | |
| 57 | const cleanup = eos(stream, { readable: reading, writable: writing }, (err) => { |
| 58 | finished = !err; |
| 59 | }); |
| 60 | |
| 61 | return { |
| 62 | destroy: (err) => { |
| 63 | if (finished) return; |
| 64 | finished = true; |
| 65 | destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe')); |
| 66 | }, |
| 67 | cleanup, |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | function popCallback(streams) { |
| 72 | // Streams should never be an empty array. It should always contain at least |
no test coverage detected