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 <[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]>
1 parent e0cc79d commit d9331e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/api/stream.md

+1
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)