MCPcopy Index your code
hub / github.com/nodejs/node / destroy

Function destroy

lib/internal/streams/iter/classic.js:294–308  ·  view source on GitHub ↗
(err, cb)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 3

cbFunction · 0.50
resolveMethod · 0.45
returnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…