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

Method cancel

lib/internal/webstreams/transfer.js:160–173  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

158 }
159
160 async cancel(reason) {
161 try {
162 this[kState].port.postMessage({ type: 'error', value: reason });
163 } catch (error) {
164 if (error instanceof DOMException) {
165 // eslint-disable-next-line no-ex-assign
166 error = new CloneableDOMException(error.message, error.name);
167 }
168 this[kState].port.postMessage({ type: 'error', value: error });
169 throw error;
170 } finally {
171 this[kState].port.close();
172 }
173 }
174}
175
176class CrossRealmTransformWritableSink {

Callers

nothing calls this directly

Calls 2

closeMethod · 0.65
postMessageMethod · 0.45

Tested by

no test coverage detected