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

Function destroy

lib/internal/webstreams/adapters.js:385–415  ·  view source on GitHub ↗
(error, callback)

Source from the content-addressed store, hash-verified

383 },
384
385 destroy(error, callback) {
386 function done() {
387 try {
388 callback(error);
389 } catch (error) {
390 // In a next tick because this is happening within
391 // a promise context, and if there are any errors
392 // thrown we don't want those to cause an unhandled
393 // rejection. Let's just escape the promise and
394 // handle it separately.
395 process.nextTick(() => { throw error; });
396 }
397 }
398
399 if (!closed) {
400 if (error != null) {
401 PromisePrototypeThen(
402 writer.abort(error),
403 done,
404 done);
405 } else {
406 PromisePrototypeThen(
407 writer.close(),
408 done,
409 done);
410 }
411 return;
412 }
413
414 done();
415 },
416
417 final(callback) {
418 function done(error) {

Callers 8

writeFunction · 0.70
abortFunction · 0.70
doneFunction · 0.70
cancelFunction · 0.70
readFunction · 0.70

Calls 6

closeWriterFunction · 0.85
closeReaderFunction · 0.85
doneFunction · 0.70
abortMethod · 0.65
closeMethod · 0.65
cancelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…