MCPcopy Create free account
hub / github.com/angular/dev-infra / onFinished

Function onFinished

github-actions/browserstack/set-browserstack-env.js:6791–6812  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

6789 };
6790 const onDrain = function() {
6791 if (finished) {
6792 return;
6793 }
6794 if (body.resume) {
6795 body.resume();
6796 }
6797 };
6798 const onClose = function() {
6799 queueMicrotask(() => {
6800 body.removeListener("error", onFinished);
6801 });
6802 if (!finished) {
6803 const err = new RequestAbortedError();
6804 queueMicrotask(() => onFinished(err));
6805 }
6806 };
6807 const onFinished = function(err) {
6808 if (finished) {
6809 return;
6810 }
6811 finished = true;
6812 assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
6813 socket.off("drain", onDrain).off("error", onFinished);
6814 body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
6815 if (!err) {

Callers 2

onCloseFunction · 0.70
writeStreamFunction · 0.70

Calls 4

offMethod · 0.45
removeListenerMethod · 0.45
endMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected