node/lib/internal/streams
Tobias Nießen 5a0777776d
crypto: do not overwrite _writableState.defaultEncoding
This only affects the writable side of LazyTransform and should not
change the behavior of any LazyTransform streams (Cipher, Decipher,
Cipheriv, Decipheriv, Hash, Hmac).

If the user does not set defaultEncoding when creating a transform
stream, WritableState uses 'utf8' by default. Only LazyTransform
overwrites this with 'buffer' for strict backward compatibility. This
was necessary when crypto.DEFAULT_ENCODING still existed. Now that
DEFAULT_ENCODING has been removed, defaultEncoding is always 'buffer'.
The writable side of LazyTransform appears to treat 'utf8' and 'buffer'
in exactly the same way. Therefore, there seems to be no need to
overwrite _writableState.defaultEncoding at this point.

Nevertheless, because Node.js has failed to hide implementation details
such as _writableState from the ecosystem, we may want to consider this
a breaking change.

Refs: https://github.com/nodejs/node/pull/47182
Refs: https://github.com/nodejs/node/pull/8611
PR-URL: https://github.com/nodejs/node/pull/49140
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-08-27 14:12:29 +00:00
..
add-abort-signal.js stream: use addAbortListener 2023-07-11 19:50:20 +03:00
buffer_list.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00
compose.js stream: preserve object mode in compose 2023-04-12 00:20:49 +05:30
destroy.js stream: expose stream symbols 2023-03-24 07:20:18 +00:00
duplex.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00
duplexify.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00
end-of-stream.js stream: use addAbortListener 2023-07-11 19:50:20 +03:00
from.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00
lazy_transform.js crypto: do not overwrite _writableState.defaultEncoding 2023-08-27 14:12:29 +00:00
legacy.js lib: revert primordials in a hot path 2021-04-19 10:23:01 +02:00
operators.js stream: add highWaterMark for the map operator 2023-08-24 12:11:21 +00:00
passthrough.js lib: revert primordials in a hot path 2021-04-19 10:23:01 +02:00
pipeline.js stream: use addAbortListener 2023-07-11 19:50:20 +03:00
readable.js stream: fix deadlock when pipeing to full sink 2023-07-12 14:31:49 +00:00
state.js stream: add setter & getter for default highWaterMark (#46929) 2023-03-29 20:02:10 +02:00
transform.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00
utils.js stream: expose stream symbols 2023-03-24 07:20:18 +00:00
writable.js stream: add trailing commas in stream source files 2023-02-18 17:53:57 +00:00