node/lib/internal/streams
Joyee Cheung 413fcada8f stream: do not use crypto.DEFAULT_ENCODING in lazy_transform.js
The default encoding can be retrieved via
`require('internal/crypto/util').getDefaultEncoding` instead of
the deprecated crypto.DEFAULT_ENCODING which triggers a warning.

Background:

The require chain goes like this:

```
internal/streams/lazy_transform.js
  -> crypto.js
  -> internal/crypto/cipher.js (uses LazyTransform in the global scope)
  -> internal/streams/lazy_transform.js
```

So when `internal/streams/lazy_transform.js` is required before
`lib/crypto.js`, we have a circular dependency and since
`internal/crypto/cipher.js` uses destructuring to use LazyTransform
we will get an error. And it can also trigger a warning if
lazy_transform.js is the first file that touches
crypto.DEFAULT_ENCODING.

PR-URL: https://github.com/nodejs/node/pull/24396
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-18 08:40:23 -08:00
..
async_iterator.js stream: do not error async iterators on destroy(null) 2018-10-28 15:02:10 +01:00
buffer_list.js stream: improve buffer list inspection 2018-10-02 10:34:34 +02:00
destroy.js stream: add auto-destroy mode 2018-10-30 15:17:40 +01:00
duplexpair.js tls: make deprecated tls.createSecurePair() use public API 2018-01-14 14:49:41 +01:00
end-of-stream.js lib: require a callback for end-of-stream 2018-08-22 01:00:27 +02:00
lazy_transform.js stream: do not use crypto.DEFAULT_ENCODING in lazy_transform.js 2018-11-18 08:40:23 -08:00
legacy.js lib,test: remove yoda statements 2018-03-04 15:33:18 +01:00
pipeline.js fs: ensure readdir() callback is only called once 2018-09-13 08:13:17 -04:00
state.js stream: refactor getHighWaterMark in state.js 2018-05-18 15:22:42 +02:00