(err, cb)
| 292 | } |
| 293 | }, |
| 294 | destroy(err, cb) { |
| 295 | done = true; |
| 296 | // Wake up the pump if it's waiting on backpressure so it |
| 297 | // can see done === true and exit cleanly. |
| 298 | if (backpressure) { |
| 299 | backpressure.resolve(); |
| 300 | backpressure = null; |
| 301 | } |
| 302 | if (typeof iterator.return === 'function') { |
| 303 | PromisePrototypeThen(iterator.return(), |
| 304 | () => cb(err), (e) => cb(e || err)); |
| 305 | } else { |
| 306 | cb(err); |
| 307 | } |
| 308 | }, |
| 309 | }); |
| 310 | |
| 311 | if (signal) { |