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 Jan 31, 2022
1 parent 51253a3 commit 93666d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/stream.md
Expand Up @@ -2482,6 +2482,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 93666d3

Please sign in to comment.