Skip to content

Commit d9331e4

Browse files
Gena888danielleadams
authored andcommitted
doc: 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. 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>
1 parent e0cc79d commit d9331e4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

doc/api/stream.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,6 +2482,7 @@ class WriteStream extends Writable {
24822482
constructor(filename) {
24832483
super();
24842484
this.filename = filename;
2485+
this.fd = null;
24852486
}
24862487
_construct(callback) {
24872488
fs.open(this.filename, (err, fd) => {

0 commit comments

Comments
 (0)