From cc35aaac830d9a1c7b4a900a4079687f33a635ae 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 4f242a5d519da2..8ca8fb1db5c0f1 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2612,6 +2612,7 @@ class WriteStream extends Writable { constructor(filename) { super(); this.filename = filename; + this.fd = null; } _construct(callback) { fs.open(this.filename, (err, fd) => {