Unverified Commit 3ee076f0 authored by Luigi Pinca's avatar Luigi Pinca Committed by Beth Griggs
Browse files

stream: ensure writable.destroy() emits error once

Prevent the `'error'` event from being emitted multiple times if
`writable.destroy()` is called with an error before the `_destroy()`
callback is called.

Emit the first error, discard all others.

PR-URL: https://github.com/nodejs/node/pull/26057
Backport-PR-URL: https://github.com/nodejs/node/pull/28000
Fixes: https://github.com/nodejs/node/issues/26015


Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent cc9d0056
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment