Skip to content

Commit cc35aaa

Browse files
Gena888Linkgoron
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: nodejs#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 52a8bd1 commit cc35aaa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/api/stream.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,6 +2612,7 @@ class WriteStream extends Writable {
26122612
constructor(filename) {
26132613
super();
26142614
this.filename = filename;
2615+
this.fd = null;
26152616
}
26162617
_construct(callback) {
26172618
fs.open(this.filename, (err, fd) => {

0 commit comments

Comments
 (0)