Skip to content

Commit 6a9db2e

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 f9cf50f commit 6a9db2e

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
@@ -2470,6 +2470,7 @@ class WriteStream extends Writable {
24702470
constructor(filename) {
24712471
super();
24722472
this.filename = filename;
2473+
this.fd = null;
24732474
}
24742475
_construct(callback) {
24752476
fs.open(this.filename, (err, fd) => {

0 commit comments

Comments
 (0)