doc: document error event is optionally emitted after .destroy() · nodejs/node@8de9fe9 (original) (raw)

`@@ -372,10 +372,10 @@ added: v8.0.0

`

372

372

`` * error {Error} Optional, an error to emit with 'error' event.

``

373

373

`* Returns: {this}

`

374

374

``

375

``

`` -

Destroy the stream. Optionally emit an 'error' event, and always emit

``

376

``

`` -

a 'close' event.

``

377

``

`-

After this call, the writable stream has ended and subsequent calls

`

378

``

`` -

to write() or end() will result in an ERR_STREAM_DESTROYED error.

``

``

375

`` +

Destroy the stream. Optionally emit an 'error' event, and emit a 'close'

``

``

376

`` +

event unless emitClose is set in false. After this call, the writable

``

``

377

`` +

stream has ended and subsequent calls to write() or end() will result in

``

``

378

`` +

an ERR_STREAM_DESTROYED error.

``

379

379

`This is a destructive and immediate way to destroy a stream. Previous calls to

`

380

380

`` write() may not have drained, and may trigger an ERR_STREAM_DESTROYED error.

``

381

381

`` Use end() instead of destroy if data should flush before close, or wait for

``

`@@ -876,9 +876,10 @@ added: v8.0.0

`

876

876

`` * error {Error} Error which will be passed as payload in 'error' event

``

877

877

`* Returns: {this}

`

878

878

``

879

``

`` -

Destroy the stream, and emit 'error' and 'close'. After this call, the

``

880

``

`-

readable stream will release any internal resources and subsequent calls

`

881

``

`` -

to push() will be ignored.

``

``

879

`` +

Destroy the stream. Optionally emit an 'error' event, and emit a 'close'

``

``

880

`` +

event unless emitClose is set in false. After this call, the readable

``

``

881

`` +

stream will release any internal resources and subsequent calls to push()

``

``

882

`+

will be ignored.

`

882

883

`Implementors should not override this method, but instead implement

`

883

884

`` [readable._destroy()][readable-_destroy].

``

884

885

``

`@@ -1342,11 +1343,12 @@ added: v8.0.0

`

1342

1343

`-->

`

1343

1344

`` * error {Error}

``

1344

1345

``

1345

``

`` -

Destroy the stream, and emit 'error'. After this call, the

``

``

1346

`` +

Destroy the stream, and optionally emit an 'error' event. After this call, the

``

1346

1347

`transform stream would release any internal resources.

`

1347

1348

`Implementors should not override this method, but instead implement

`

1348

1349

`` [readable._destroy()][readable-_destroy].

``

1349

``

`` -

The default implementation of _destroy() for Transform also emit 'close'.

``

``

1350

`` +

The default implementation of _destroy() for Transform also emit 'close'

``

``

1351

`` +

unless emitClose is set in false.

``

1350

1352

``

1351

1353

`### stream.finished(stream[, options], callback)

`

1352

1354

`<!-- YAML

`