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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
Gena888 authored and danielleadams committed Dec 13, 2021
1 parent 9cfdf15 commit 94d0911
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 @@ -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) => {
Expand Down

0 comments on commit 94d0911

Please sign in to comment.