From 6a9db2ebdb2af2655328e2c9e24a02486994baff Mon Sep 17 00:00:00 2001 From: Henadzi <74081058+Gena888@users.noreply.github.com> Date: Tue, 2 Nov 2021 21:52:43 +0300 Subject: [PATCH] doc: add explicit declaration of fd with null val MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In example of implementing a writable stream with extending on Writable add explicit declaration of 'fd' (file descriptor) variable with null value. It will make this example more similar to readable stream's one. And will make it easier to figure out in topic. PR-URL: https://github.com/nodejs/node/pull/40704 Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Minwoo Jung Reviewed-By: James M Snell Reviewed-By: Matteo Collina --- doc/api/stream.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 1c1aa9289f0aa3..a461eb2aef41e4 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2470,6 +2470,7 @@ class WriteStream extends Writable { constructor(filename) { super(); this.filename = filename; + this.fd = null; } _construct(callback) { fs.open(this.filename, (err, fd) => {