From 94d09113a21e96aaab86f577d4e0e815dfd70c64 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 7ff94e71f2b062..c2f5a6fe43ca68 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2558,6 +2558,7 @@ class WriteStream extends Writable { constructor(filename) { super(); this.filename = filename; + this.fd = null; } _construct(callback) { fs.open(this.filename, (err, fd) => {