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

Function emitErrorNT

lib/internal/streams/destroy.js:152–171  ·  view source on GitHub ↗
(self, err)

Source from the content-addressed store, hash-verified

150}
151
152function emitErrorNT(self, err) {
153 const r = self._readableState;
154 const w = self._writableState;
155
156 if (
157 (w && (w[kState] & kErrorEmitted) !== 0) ||
158 (r && (r[kState] & kErrorEmitted) !== 0)
159 ) {
160 return;
161 }
162
163 if (w) {
164 w[kState] |= kErrorEmitted;
165 }
166 if (r) {
167 r[kState] |= kErrorEmitted;
168 }
169
170 self.emit('error', err);
171}
172
173function undestroy() {
174 const r = this._readableState;

Callers 2

emitErrorCloseNTFunction · 0.70
errorOrDestroyFunction · 0.70

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected