Skip to content

Commit 94d0911

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 9cfdf15 commit 94d0911

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
@@ -2558,6 +2558,7 @@ class WriteStream extends Writable {
25582558
constructor(filename) {
25592559
super();
25602560
this.filename = filename;
2561+
this.fd = null;
25612562
}
25622563
_construct(callback) {
25632564
fs.open(this.filename, (err, fd) => {

0 commit comments

Comments
 (0)