diff options
-rw-r--r-- | doc/api/stream.md | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index 14724e8311..2bde10c1fe 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1652,8 +1652,7 @@ const { StringDecoder } = require('string_decoder'); class StringWritable extends Writable { constructor(options) { super(options); - const state = this._writableState; - this._decoder = new StringDecoder(state.defaultEncoding); + this._decoder = new StringDecoder(options && options.defaultEncoding); this.data = ''; } _write(chunk, encoding, callback) { |