MCPcopy Create free account
hub / github.com/nodejs/node / emitCloseNT

Function emitCloseNT

lib/internal/streams/destroy.js:133–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

131}
132
133function emitCloseNT(self) {
134 const r = self._readableState;
135 const w = self._writableState;
136
137 if (w) {
138 w[kState] |= kCloseEmitted;
139 }
140 if (r) {
141 r[kState] |= kCloseEmitted;
142 }
143
144 if (
145 (w && (w[kState] & kEmitClose) !== 0) ||
146 (r && (r[kState] & kEmitClose) !== 0)
147 ) {
148 self.emit('close');
149 }
150}
151
152function emitErrorNT(self, err) {
153 const r = self._readableState;

Callers 1

emitErrorCloseNTFunction · 0.70

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected