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: nodejs#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 Linkgoron committed Jan 31, 2022
1 parent 52a8bd1 commit cc35aaa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit cc35aaa

Please sign in to comment.