Skip to content

Commit

Permalink
doc: add explicit declaration of fd with null val
Browse files Browse the repository at this point in the history
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: #40704
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
Gena888 authored and danielleadams committed Feb 1, 2022
1 parent f9cf50f commit 6a9db2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/stream.md
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6a9db2e

Please sign in to comment.