From 3aaa09e4a8ba993a902d36e11fdbbdb17941c493 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] feat: add explicit declaration of fd with null val 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. --- doc/api/stream.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 91fe70555d0e46..704fefe92756fc 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) => {